Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Bug: The "casesensitive" flag is handled inconsistently in search

Please see the test cases below. When the casesensitive flag is selected, the behavior differs between topic and text scope:

  • With scope=topic, if casesensitive is among the options, search is casesensitive (whether set to on or off), but regex is never used;
  • with scope=text, if regex is among the options, search is regular expression (whether set to on or off), and casesensitivity is determined based on the regular expression setting.

Test case

ALERT! Test cases commented out due to performance problems on twiki.org

  • casesensitive="on", regex="on"
%SEARCH{ "location" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • casesensitive="on", regex="off"
%SEARCH{ "location" casesensitive="on" regex="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • casesensitive="on"
%SEARCH{ "location" casesensitive="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • casesensitive="off", regex="on"
%SEARCH{ "location" casesensitive="off" regex="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • casesensitive="off", regex="off"
%SEARCH{ "location" casesensitive="off" regex="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • casesensitive="off"
%SEARCH{ "location" casesensitive="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • regex="on"
%SEARCH{ "location" regex="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • regex="off"
%SEARCH{ "location" regex="off" nosearch="off" nototal="on" web="Main" format=" * $web.$topic" }%
  • none
%SEARCH{ "location" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", casesensitive="on", regex="on"
%SEARCH{ "location" scope="topic" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", casesensitive="on", regex="off"
%SEARCH{ "location" scope="topic" casesensitive="on" regex="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", casesensitive="on"
%SEARCH{ "location" scope="topic" casesensitive="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", casesensitive="off", regex="on"
%SEARCH{ "location" scope="topic" casesensitive="off" regex="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", casesensitive="off", regex="off"
%SEARCH{ "location" scope="topic" casesensitive="off" regex="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", casesensitive="off", regex="on"
%SEARCH{ "location" scope="topic" casesensitive="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", regex="on"
%SEARCH{ "location" scope="topic" regex="off" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text", regex="off"
%SEARCH{ "location" scope="topic" regex="on" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%
  • scope="text"
%SEARCH{ "location" scope="topic" nosearch="on" nototal="on" web="Main" format=" * $web.$topic" }%

Observed result

scope case regex cmd args result
text on on egrep -i -l -H wrong
text on off egrep -i -l -H wrong
text on   fgrep -l -H correct
text off on egrep -i -l -H wrong
text off off egrep -i -l -H wrong
text off   fgrep -l -H wrong
text   on egrep -l -H wrong
text   off egrep -l -H wrong
text     egrep -l -H wrong
topic on on grep   wrong
topic on off grep   wrong
topic on   grep   wrong
topic off on grep   wrong
topic off off grep   wrong
topic off   grep   wrong
topic   on grep /i correct
topic   off grep /i correct
topic     grep /i correct

Environment

TWiki version: DakarRelease
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- ThomasWeigert - 31 May 2005

Follow up

Fix record

The -i option for egrep in lib/TWiki.cfg appears to be backwards. When switching these around, the search behaves as expected (at least for case sensitive).

Fix in SVN 4346.

Discussion

This seems to be a fixed bug. I'm marking it MergedToCore

-- TWikiJanitor - 10 Sep 2008

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2008-09-10 - TWikiJanitor
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.