Example
Do a search like
%SEARCH{ "Test" web="%WEB%" topic="SomeNonExistentPage" }%
with the
TWiki::Store::SearchAlgorithms::Forking
algorithm. In the "rendered" page you get an error of the form
Could not perform search. Error was: /bin/grep -F -i -l -H -- %TOKEN|U% %FILES|F% Grep for 'Test' returned error
If you choose some e.g.
TWiki::Store::SearchAlgorithms::PurePerl
as your search algo, you get no errors (and no hits, of course).
Reason
Taking a look at
Forking.pm
, you can see
throw Error::Simple("$program Grep for '$searchString' returned error")
if $exit > 1;
But grep's return error code is 2, because the topic cannot be found.
This behaviour is new to 4.2 and differs from 4.1.2.
--
TWiki:Main/ChristianLudwig
- 21 Sep 2007
Flip side of this, is that perhaps TWiki should not be calling grep on topics that don't exist - as each fork of a process is slow.
Good find!
--
TWiki:Main.SvenDowideit
- 21 Sep 2007
I changed the grep command from /bin/egrep to /bin/grep -E for consistency with Windows. Looks like it may have been a bad move
A testcase is required for this.
--
TWiki:Main.CrawfordCurrie
- 22 Sep 2007
Fixed
CC