Question
Hi All,
I am currently putting together a bug tracking system based on the Twiki system in the Codev web. It uses an inline search to search through the list of bugs. Currently, there are two search pages. One displays bugs classified by status (Fixed or Active.) The other classifies bugs by 'Owner' (the person assigned to fix the bug.)
The search strings are shown below (copied from the Codev system.) They are searching for data which is held as Meta-Data for a form.
| *Bug:* | *Last Author:* | *Last Change - Version:* |
%SEARCH{ "[B]ugStatus.*value\=.*[A]ctive" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| *[[$topic]]*: $summary | $wikiusername | $date - $rev - [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic][Diffs]] |"}%
"| *Bug:* | *Last Author:* | *Last Change - Version:* |
%SEARCH{ "[O]wner.*value\=.*[J]im D" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| *[[$topic]]*: $summary | $wikiusername | $date - $rev - [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic][Diffs]] |"}%"
These both work well. However, an obvious flaw in the second string is that it pulls up all bugs assigned to Jim D regardless of whether they are fixed or active.
Hence, I tried the following string....
"| *Bug:* | *Last Author:* | *Last Change - Version:* |
%SEARCH{ "([O]wner.*value\=.*[J]im D);([B]ugStatus.*value\=.*[A]ctive)" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| *[[$topic]]*: $summary | $wikiusername | $date - $rev - [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic][Diffs]] |"}%"
This fails to return anything. If we replace the ; with a | (OR instead of AND) then it works fine (i.e. we get all bugs which are fixed or owned by Jim D) but I can't get And to work. Does anyone have any ideas? I suspect that there is an obvious flaw but I can' see it!
- TWiki version: Dec 2001
- Web server: Apache 1.3.27
- Server OS: Win NT
- Web browser: IE 5
- Client OS: Win 2K
--
JimDonaldson - 26 Nov 2002
Answer
Do not use the parenthesis and you should be fine, e.g.:
"[O]wner.*value\=.*[J]im D;[B]ugStatus.*value\=.*[A]ctive"
Example: Show all Codev topics of
TopicClassification equal
FeatureUnderConstruction and
ProjectGroup equal
CodeBaseProject:
Topics:
Codev.RenderFormAsRegularTable,
Codev.SearchScriptWithFormattedSearch,
Codev.SeparateCustomPreferencesPatch,
Number of topics: 3
--
PeterThoeny - 26 Nov 2002
Continuing
Thanks for your response Peter. Unfortunately, it didn't work. I can't get AND (;) to work anwhere in our wiki. I've tried using it directly on the search page
i.e
typing "Jim" (returns lots)
typing "Active" (again returns lots, many of which were also returned by "Jim")
typing "Jim|Active" (which returns lots)
typing "Jim;Active" which returns nothing.
Trying an equivalent test on the twiki.org pages works fine.
To my knowledge, none of the scripts have been modified. Where is the (;) search implemented? Is there anywhere apart from search and search.pm that coul affect things?
Does my version of Twiki support this? (Dec 2001)
Would it be better to updgrade to the latest beta?
Sorry for all the hassle,
--
JimDonaldson - 06 Dec 2002
See
SearchWithAnd - this is not in the Dec 2001 release but is in the
TWikiAlphaRelease (or any
TWikiBetaRelease since it was implemented some time ago). See those pages for details of getting hold of alphas and betas. If you don't want to upgrade, see
CategorySearchForm - the
andgrep script is similar, but it would be best to use the beta release since
andgrep is quite old.
--
RichardDonkin - 06 Dec 2002