We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Support Web>HowToSearchFormFields2 (07 Jun 2008, TWikiGuest)
Tags:
create new tag
, view all tags

Question

I have not been able to get searching to work, when looking for form field values. Regardless of what I try the searches always come back empty.

I've read the HowToSearchFormFields, SearchPatternCookbook, FormattedSearch, and VarSEARCH topics, and many others. None of the example syntaxes seem to work.

We are using CVS as the backing store for TWiki (in case it matters).

Here are my latest attempts, but return nothing:

%SEARCH{"[T]echLead.*value=.*[J]ohnNorvell" regex="on" type="regex" scope="text" format="| [[$topic]] |"}%

and

%METASEARCH{type="formfield" name="TechLead" value="JohnNorvell"}%

Also, is it possible to search for multiple form field / values in a single statement? I haven't seen any examples to do that.

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: IfDefinedPlugin FilterPlugin VersionLinkPlugin WebPermissionsPlugin RenderListPlugin WysiwygPlugin XpTrackerPlugin
Server OS: SunOS? 5.8
Web server: Apache
Perl version:  
Client OS: Windows XP SP2
Web Browser: Firefox 2.0.0.12
Categories: Forms, Search

-- JohnENorvell - 04 Mar 2008

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.

TWiki will search for meta data in topics in this format:
%META:FIELD{name="TechLead" attributes="" title="TechLead" value="JohnNorvell"}%

Check your topics if this data is stored.

-- ArthurClemens - 04 Mar 2008

The TWikiInstallation application is an example of a search on multiple form fields.

-- PeterThoeny - 05 Mar 2008

When I try:


it just echos back the command as if it couldn't parse it.

When I tried:

%SEARCH{ search="META:FIELD.*?TechLead.*?JohnNorvell" regex="on" nosearch="on" format="| [[$topic]] | $formfield(ProjectName) |" }%

it parsed, but returned no results.

How can I verify for sure that the metadata is stored properly? When I examine the topic page, the form table is visible at the end of the page with the variables and values. Is there a way to look at the "raw" table data as stored in Twiki (aside from looking at the HTML page source).

-- JohnENorvell - 05 Mar 2008

Just taking your search from above into the current topic:

%SEARCH{ search="META:FIELD.*?TechLead.*?JohnNorvell" regex="on" nosearch="on" format="| [[$topic]] | $formfield(ProjectName) |" }%

HowToSearchFormFields2  
Number of topics: 1

There you are - the current topic is found. So, in theory and on twiki.org, it seems to work. Maybe it is indeed your backend store which confuses TWiki? Do "normal" searches outside form fields work as expected?

Or is it your grep package? TWiki's search is based on a naive grep, GNU grep in particular, and there have on occasion been configuration problems with that, in particular on Solaris which has a GNU-incompatible grep. If I recall correctly, installing GNU grep and adjusting the paths in /bin/configure is the recommended solution for that.

And, BTW: You can look at the raw data including meta data by using the raw=debug parameter, as in:
http://twiki.org/cgi-bin/view/Support/HowToSearchFormFields2?raw=debug

-- HaraldJoerg - 05 Mar 2008

Simple searches do work, but if I use the Advanced Search form and enter the META search above it doesn't return anything. I used the raw = debug and verified that the formfields are stored with the topic pages, so that doesn't seem to be the problem.

I will look into the GNU grep and see if that makes any difference.

-- JohnENorvell - 05 Mar 2008

Closing this question after more than 30 days of inactivity. Feel free to re-open if needed.

-- PeterThoeny - 01 May 2008

I had the same problem - it turned out that in configuring paths to grep, I had eliminated the parameters ( %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%). Adding these back using the configure script fixed the search problem. -- FG

-- TWikiGuest - 07 Jun 2008

 
Change status to:

Topic revision: r9 - 07 Jun 2008 - 18:08:17 - TWikiGuest
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback