I have an embedded search of the form:
%SEARCH{search="%TOPIC%" topic="NagSvc*" nosearch="on" noheader="on" nototal="on" format=" * [[$topic]] --- $pattern(.*Service Description\s*([^\n]{1,140}).*)..." }%
(this generates a list of twiki pages with the topic name and first 140 characters of the Service Description section). that was returning no hits.
A simplified search:
%SEARCH{ "%TOPIC%" }%
also returns no hits.
Using the search box returns the list of expected pages.
I am using cgi mode (not mod_perl) for twiki running under apache 2.2.3 with perl 5.8.8.
I narrowed it down today to a problem in lib/TWiki/Store/SearchAlgorithms/PurePerl.pm. If I change (line 58 approx) from:
if ($options->{casesensitive}) {
$doMatch = sub { $_[0] =~ m/$searchString/o };
} else {
$doMatch = sub { $_[0] =~ m/$searchString/oi };
}
to
if ($options->{casesensitive}) {
$doMatch = sub { $_[0] =~ m/$searchString/ };
} else {
$doMatch = sub { $_[0] =~ m/$searchString/i };
}
i.e. removing the "o" compile once option made the search work as intended.
I know the embedded search worked on an earlier (revision 4.x) search., but I am not positive that I was using the
PurePerl search module at that time.
--
TWiki:Main/JohnRouillard - 2012-12-25
Actually it looks like I took a patch from
http://mark.aufflick.com/blog/2008/07/20/twiki-on-fastcgi because I was trying to get TWiki working on fastcgi. I reverted the patch and the search still appears to work.
So this is an invalid ticket. Sorry about that.
--
JohnRouillard - 2012-12-25