You are here: Foswiki>Tasks Web>Item8644 (28 Feb 2010, ArthurClemens)Edit Attach

Item8644: SearchAlgorithms alter search tokens

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: ArthurClemens
Waiting For:
Last Change By: ArthurClemens
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

 

ItemTemplate edit

Summary SearchAlgorithms alter search tokens
ReportedBy ArthurClemens
Codebase trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:b1c7ae68eb85
TargetRelease n/a
ReleasedIn
Topic revision: r1 - 28 Feb 2010, ArthurClemens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy