Opac search using 'Does not contain' has parsing error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Mike Rylander |
Bug Description
Using the OPAC on catalog.kcls.org (version 2) or on catalogue.
Author Matches exactly 'Madonna'
Title Does not contain ' sex music'
the search hangs and an opensrf error is returned (on catalog.kcls.org at least) containing the phrase 'ERROR: syntax error in tsquery'. The returned search term looks like
author:"madonna" title:- -sex - -music
showing that the extra white space entered before 'sex' and 'music' are parsed as tokens. Instead the OPAC should remove duplicate white spaces from the search term before appending the '-' prefix, or something like that.
If the extra white spaces are not entered, the search succeeds.
Also, the OPAC is also caught spinning forever when it encounters the error; instead it should show the error in a popup box or something.
The problem seems to be related to https:/
Changed in evergreen: | |
milestone: | none → 2.0beta5 |
The problem is that the OPAC code in Open-ILS/ web/opac/ skin/default/ js/adv_ global. js (adjust for skin) is blinding splitting on spaces and prepending - to each "word". This is fine, but we need to watch out for empty "words". The simplest thing to do is avoid that completely by removing doubled, leading and trailing spaces when dealing with a notcontains term. See: http:// svn.open- ils.org/ trac/ILS/ changeset/ 18901
To be backported pending independent confirmation of the fix.
Note: while it wouldn't hurt to invest in avoiding this at the query parser level as well (bug #605921), that is a different, broader angle of attack.