I set up a Bug tracking system using the
WikiForms, and then i was shocked to find out that there was absolutly
no support for searching or reporting of
WikiForm data.
at bare minimum we should have:
%<nop>SEARCH{"field1=something, field2 = another OR one" type="metasearch" result="UseThisTopic"}%
which uses the user defined
UseThisTopic topic to display the results of a search where
the value of %METAFIELD {name="field1"}% is "something" AND the value of %METAFIELD{name="field2"}% is either "another" OR "one"
UseThisTopic should be able to go into details..
---------------snip-----------------
This is a heading for a search result
<repeat>
| %COUNT% | %TOPICNAME% | %METAFIELD{name="field1"}% |
%METAFIELD{name="field2"}% | %METAFIELD{name="field3"}% | %CHANGEDTIME% | %CHANGEDBY% | %REVISION% | </repeat> this is after the list of results
------------------------------------
it should also be possible for a topic to specify the defailt SEARCH summary format (again by referenceing a topic )
We also need to have an autogenerated FORM for searching pages that are defined using metadata
AND THEN my Boss pointed out something very obvious. If you have this kind of structure, you should be able to do
SQL style queries.... which brings me to another idea - I might be writing an
SQL plugin to access a database (like %INCLUDE and instead of metadata)..
--
SvenDowideit - 25 Oct 2001
Funny you ask. I actually just implemented an enhancement to search where you can specify the format of a search hit, i.e. show a table with specified values instead of the topic summary. The format string can include topic name, author, date and form fields. Will post it soon to Alpha.
--
PeterThoeny - 25 Oct 2001
excellent

if i wasn't sick i'd look today - i assume its in cvs..
--
SvenDowideit
Have a look at
CategorySearchForm - the
andgrep tool mentioned there lets you do this, i.e. specify regular expressions to find field1=X and field2=Y, etc. Pretty basic but it works for me. The results of searches are identical to normal grep, though - no table formatting.
--
RichardDonkin - 28 Oct 2001
mmmm thankyou Richard, of course, after figuring out how to use your script I realised I want an
OrGrep initially - what joy
--
SvenDowideit - 30 Oct 2001
I'm very new to TWiki, and was also implementing a bug database and was similarly shocked to
find there is no proper way of searching form data.
Unless I missed something, none of the replies here explained how to
search form data,
only how to report it. After literally hours of trawling topics to no avail (where are
the topics which explain quoting of meta-characters within a %SEARCH% directive, for instance?),
the light
suddenly dawned - the search is using grep, so looking at the raw text files on the server
will reveal what to search for. It did ...
To search for all topics with form data for
MyWebForm:
%SEARCH{ "META:FORM{name=\"MyWebForm\"" }
Similarly, something like
%SEARCH{ "META:FIELD{name=\"MyWebFormField\" value=\"...\"" }
should search for topics whose
MyWebFormField is a given value.
--
AdamSpiers - 14 Oct 2002
That is the idea, do a
RegularExpression search on the form field meta tags.
TWikiInstallations is an example in action, it does an AND search on several fields. For example,
META:FIELD.*?=\"MyFavoriteFood\".*Sushi;META:FIELD.*?\"MyFavoriteDrink\".*Wine
--
PeterThoeny - 14 Oct 2002
We really really need to make a non-techy way of creating non-trivial querys.
SQL isn't a bad start, but free form text or something should be examined somehow.
--
SvenDowideit - 19 Jan 2003
Sven, you are on the right track, a
SimpleSqlForTWikiFormData would be a nice enhancement.
--
PeterThoeny - 23 Jan 2003
see
SearchByDate for another requirement
--
SvenDowideit - 26 Feb 2003
Isn't this what
CategorySearchForm was about?
--
PeterKlausner - 26 Feb 2003
not quite,
CategorySearchForm is just a small part of my needs for a fully generic Forms (Search) mechanism. just call me greedy
--
SvenDowideit - 26 Feb 2003
It seems to me to be horribly inefficient to be doing full text searches for form data. Is the
FormQueryPlugin the answer here? Is this or something like it going to be in core TWiki?
--
JohnMcLaughlin - 23 Sep 2003
I still find these horribly unintuitive to set up. For anyone's (mostly mine) reference, here's how I search for pages of the type
GoalForm:
%SEARCH{"META:FORM.*[G]oalForm" scope="text" regex="on" nosearch="on" }%
--
MartinCleaver - 07 Sep 2004
I was looking for this exact feature today and came across this page. Is this still the only way, or is there a better solution?
I need to find topics that have a certain form field value, e.g. Category=Personal.
Thanks.
--
PankajPant - 03 Mar 2006
The basic
RegularExpression syntax for searches to find values in formfields is this (using your example):
%SEARCH{"[C]ategory].*value\=.*[P]ersonal" regex="on" }%
The brackets "[ ]" around the first letter of Category and Personal are so that your search doesn't find itself.
I know it looks a little obscure at first but once you use it a little bit, it is pretty easy. For more help on search patterns, see
SearchPatternCookbook.
--
LynnwoodBrown - 03 Mar 2006
In the new TWiki 4.0 release, there is an option of METASEARCH to look into form fields. Check it out.
--
RafaelAlvarez - 03 Mar 2006
Thanks Lynnwood. I'll try that out.
Rafael, we are using Cairo and unfortunately will be stuck on that for a while :-(. If the METASEARCH feature could be back-ported to Cairo, it would be great.
--
PankajPant - 03 Mar 2006