LP#1373601: Consider relevant characters before using word-boundary checks user/miker/lp1373601-phrase-search-punctuation
authorMike Rylander <mrylander@gmail.com>
Tue, 22 Mar 2016 15:50:58 +0000 (11:50 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 22 Mar 2016 15:50:58 +0000 (11:50 -0400)
commit67f4bcc367a509d0b6e0cc94cda9172d7f8433bc
tree52d574ae8dcb416086a817f1b0d399c541612b35
parent0d2b61d8669a9a540cf1b80ba64a1a67c3b4095d
LP#1373601: Consider relevant characters before using word-boundary checks

To perform unanchored phrase limits, we make sure that the phrase supplied
by the user does not end in the middle of a word by bounding the condition
with word-boundary bracket expresssions.  However, if the phrase starts
or ends with a non-word character (that is, something other than numbers,
letters, or the underscore) then the word-boundary expression won't match.
The effect of this is to cause phrase searches starting or ending in
punctuation to fail when the user would not expect them to.

To address this, we now test the phrase for word-iness at the front and
back before applying word-boundary bracket expressions.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm