Skip Menu |

This queue is for tickets about the Search-QueryParser CPAN distribution.

Report information
The Basics
Id: 32840
Status: resolved
Priority: 0/
Queue: Search-QueryParser

People
Owner: DAMI [...] cpan.org
Requestors: f.wesemann [...] fotofinder.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Boolean Connectors
Date: Thu, 31 Jan 2008 17:46:24 +0100
To: bug-Search-QueryParser [...] rt.cpan.org
From: Frank Wesemann <f.wesemann [...] fotofinder.net>
Dear Maintainer, in QueryParser-0.92 in line 397-398 the boolean connectors are evaluated through the RegEx if (s/^($self->{rxAnd})\s*//) { $postBool = 'AND' } #( a AND followed by a whitespace or not ) This leads the term "Prince Edward" to be parsed to: $QUERY = { '+' => [ { 'value' => 'Prince', 'op' => ':', 'field' => '' }, { 'value' => 'dward', 'op' => ':', 'field' => '' } ] }; due to the spanish "E". So shouldn't the regex in line 397 read s/^($self->{rxAnd})\s+// # ( a AND followed by at least one whitespace ) ? best regards -- mit freundlichem Gruß, Frank Wesemann Fotofinder GmbH USt-IdNr. DE812854514 Software Entwicklung Web: http://www.fotofinder.net/ Potsdamer Str. 96 Tel: +49 30 25 79 28 90 10785 Berlin Fax: +49 30 25 79 28 999 Sitz: Berlin Amtsgericht Berlin Charlottenburg (HRB 73099) Geschäftsführer: Ali Paczensky
Le Jeu. Jan. 31 14:33:34 2008, f.wesemann@fotofinder.net a écrit : Show quoted text
> Dear Maintainer, > in QueryParser-0.92 > in line 397-398 the boolean connectors are evaluated through the
RegEx Show quoted text
> if (s/^($self->{rxAnd})\s*//) { $postBool = 'AND' } #( a AND
followed Show quoted text
> by a whitespace or not ) > This leads the term "Prince Edward" to be parsed to: > $QUERY = { > '+' => [ > { > 'value' => 'Prince', > 'op' => ':', > 'field' => '' > }, > { > 'value' => 'dward', > 'op' => ':', > 'field' => '' > } > ] > }; > due to the spanish "E". > So shouldn't the regex in line 397 read > s/^($self->{rxAnd})\s+// # ( a AND followed by at least one
whitespace ) Show quoted text
> ? > > best regards > >
Fixed in v0.93, just submitted to CPAN. The regex now is s/^($self->{rxAnd})\b\s*// -- not exactly like what you suggested, but this allows for expressions like a AND(b OR c) # no space after AND Thanks for your bug report. Regards, L. Dami