Tags:
create new tag
, view all tags

Question

Hi,

I am trying to search within a form field (meta data) which value is a coma separated text. I am trying to find that form, the meta field, and at the end to search its value for a specific text. It is important to note that the coma separated text is actually a text generated by the form multiple check boxes which have been selected.

When I am using simple search of forms meta data it finds the text 'PSL' and works fine – code example:

|*Name* |*FPGAExperience*| *Topic* | *SystemVerilog*|*PSL*|*Specmen*|*Vera*|*DevelopmentPreferences*|
%SEARCH{"META:FIELD.*[L]anguageTool.*[P]SL" regex="on" scope="text" nosearch="on" nototal="on" 
format="| <nop>$formfield(Name)    | <nop>$formfield(FPGAExperience)  | <b>[[$web.$topic][$topic]]</b> |<nop>$formfield(LanguageTool) | PSL   |   |   | <nop>$formfield(DevelopmentPreferences)   |" web="Sandbox"}%

But when I try to nest the search within a search than it report hits all the time even if the meta field value doesn't have the 'PSL' text I am searching for.

|*Name* |*FPGAExperience*| *Topic* | *SystemVerilog*|*PSL*|*Specmen*|*Vera*|*DevelopmentPreferences*|
%SEARCH{"FPGADesigner;FORM.*name=\"DessTestForm\"" scope="text" regex="off" nosearch="on" nototal="on" 
format="| <nop>$formfield(Name)    | <nop>$formfield(FPGAExperience)  | <b>[[$web.$topic][$topic]]</b> |<nop>$formfield(LanguageTool) | $percntSEARCH{ \"META\:FIELD.*LanguageTool.*PSL\"  format=\"PSL\"  regex=\"on\" scope=\"text\" nosearch=\"on\"  nototal=\"on\"  }$percnt |   |   | <nop>$formfield(DevelopmentPreferences)   |" web="Sandbox"}%

Is this a known problem or I am doing somthing wrong?

Thanks

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian
Web server: Apache 2.0.55
Perl version: 5.8.8
Client OS: Windows XP
Web Browser: Firefox 1.5.0.7
Categories: Search

-- DessislavValkov - 29 Sep 2006

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

so, you could use the $FIND() function from the SpreadSheetPlugin to look for a piece of text within another. What you do from there depends on what you want to do with the results. This way you don't need another search though, just take the formfield containing the comma separated list and run it through $FIND()

-- MatthewCardozo - 06 Oct 2006

I am not sure I understand exactly what you want to do, I assume to output 'PSL' (if the field contains it as part of a comma delimited list), else not to output anyhing. In this case I'd go for a CALC as Matthew suggests. Something like this untested example:

format="| ... | $percntCALC{$LISTIF($EXACT($item, PSL), $formfield(LanguageTool))}$percnt | ... |"

-- PeterThoeny - 28 Nov 2006

 
Change status to:
Topic revision: r4 - 2006-11-28 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.