Tags:
create new tag
view all tags

Question

Usability issue; search does not work as expected.

I like to use searches rather than manual lists where I can, so I wanted TWikiGroups to search for access group definitions. I tried to create this search:

%SEARCH{"Group$" scope="topic" noheader="on" nosearch="on" nosummary="on" type="regex"}%

(in each of the stages below I have used "Expected" instead of "Group" as the end of the topic name I want, to demonstrate the results when the query is run in this web)

OK, searching for topics whose names end in "Expected".

%SEARCH{"Expected$" scope="topic" noheader="on" nosearch="on" nosummary="on" type="regex"}%
returns
Number of topics: 2

So, cribbing the documentation, I limited it to a range of topics:

%SEARCH{"Expected$" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" type="regex"}%
which returns
Number of topics: 2

Nope, still no joy. So I searched for the empty string instead, since all the topics should contain it:

%SEARCH{"" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" type="regex"}%
which gives

Losing patience, I tried this instead:

%SEARCH{"Expected" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" type="regex"}%
which returns
Number of topics: 2
Eureka! Now, why didn't any of the other searches work, when the documentation certainly suggests they all should have?

BTW, using regex="on" instead of type="regex" does this:

%SEARCH{"Expected$" scope="topic" noheader="on" nosearch="on" nosummary="on" regex="on"}%
Number of topics: 2

%SEARCH{"Expected$" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" regex="on"}%
Number of topics: 2

%SEARCH{"" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" regex="on"}%

%SEARCH{"Expected" scope="topic" topic="*Expected" noheader="on" nosearch="on" nosummary="on" regex="on"}%
Number of topics: 2

Environment

TWiki version: TWikiBetaRelease
TWiki plugins: Most of them
Server OS: RH 7.3
Web server: Apache 2
Perl version: 5.6.1
Client OS: SuSe Linux 9
Web Browser: Konqueror

-- CrawfordCurrie - 27 Feb 2004

Answer

This is a bug, followup in Codev.TypeRegexSearchDoesNotWorkAsExpected

-- PeterThoeny - 29 Feb 2004

I assume this is the right place to follow up:

1. Tried searching for topics that start with T:

%SEARCH{"T" scope="topic" regex="off" nosearch="on" order="topic" nototal="on" format="[[$topic]]"}%

Well this did not work and showed all topics (tried it in the Sandbox)

2. Then search around the twiki and found this topic. The parameter topic = "bla" is not documented at TWikiVariables so i gave it a try (note the empty search string "", because topic ist being used:

%SEARCH{"" scope="topic" topic="T*" regex="off" nosearch="on" order="topic" nototal="on" format="[[$topic]]"}%

NOP - did not work.

3. Ok, i tried also a match against the search parameter (note "*"):

%SEARCH{"*" scope="topic" topic="T*" regex="off" nosearch="on" order="topic" nototal="on" format="[[$topic]]"}%

Upps software error: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE / at ../lib/TWiki/Search.pm line 188.

4. Ok, i tried also a match against the search parameter (note "."):

%SEARCH{"." scope="topic" topic="T*" regex="off" nosearch="on" order="topic" nototal="on" format="[[$topic]]"}%

Voila - worked.

So some questions:

  1. is topic an undocumented but supported parameter?
  2. why does scope="topic" not work. My understanding is that this limits the search to the topic name.
  3. what matches against the search string if scope="topic"? I would expect the topic name, but this would not explain the 1. and 4. testcase. It seems to match against text.
  4. if testcase 3 is not a bug, what would be the proper value for a wildcard?

-- WolfgangAlper - 23 Feb 2005

  1. Hmm, the topic="" parameter is documented in TWikiSearch
  2. Topic name search is possible. Search for ".*" if regex is on
  3. Same. Either omit regex parameter for literal search or use regex="on" for regex search. Actually, better to use type="" since regex is deprecated
  4. ".*" scope="topic" topic="T*" regex="on" etc

Better to open a new question topic for a new question.

-- PeterThoeny - 06 Apr 2005

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-04-06 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.