Bib search hangs on searches like "title ; subtitle"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Galen Charlton |
Bug Description
A search on "title ; subtitle" hangs. The corresponding exception thrown looks something like this:
Received Exception:
Name: osrfMethodException
Status: *** Call to [open-ils.
Exception: OpenSRF::EX::ERROR 2010-07-15T07:30:50 OpenSRF:
failed with exception: Exception: OpenSRF::EX::ERROR 2010-07-15T07:30:50 OpenILS:
DBD::Pg::st execute failed: ERROR: syntax error in tsquery: "()"
CONTEXT: SQL statement "SELECT m.source AS id,
AVG(
Specifically, it is choking on part of the staged query:
to_tsquery(
which evaluates to
to_tsquery(
The problem is that to_tsquery throws an exception on that; it does accept to_tsquery(
Patch is in progress to have the generated SQL detect cases where the normalized search term is the empty string; although the specific case of free-floating punctuation in the query string could be handled higher up the query parser stack, I prefer doing it lower down since it is impossible to know in advance every case where a sequence of normalizers will normalize a query term away entirely.
Changed in evergreen: | |
status: | New → Confirmed |
Note that a search on something like "foo : bar" hangs as well, but for a different reason:
DBD::Pg::st execute failed: ERROR: relation "metabib. _field_ entry" does not exist at character 2078
ARRAY_ ACCUM(DISTINCT m.source) AS records,
QUERY: SELECT m.source AS id,