Item8644: SearchAlgorithms alter search tokens
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Search terms are stored as a token array, the
$query->{token}
ref in
Search.pm
. I want to pass that array to Meta's summary creator, but along the way the token values are changed in case a minus operator is used.
For instance, if the query is "users -access", the tokens is first ['users', '!access'], then becomes ['users', 'access'].
This line in
Forking.pm
is the culprit (and similarly in
PurePerl.pm
):
$invertSearch = ( $token =~ s/^\!//o );
It looks like a copy should be made instead:
my $tokenCopy = $token;
...
$invertSearch = ( $tokenCopy =~ s/^\!//o );
Unit tests are still happy this way.
--
ArthurClemens - 28 Feb 2010