certain queries can break Group by Formats and Editions feature

Bug #1310751 reported by Jason Etheridge on 2014-04-21
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned

Bug Description

To duplicate on a system with concerto data (such as demo.evergreencatalog.com, currently running EG 2.6.0), enter (title:Piano concerto && author:bartok) into the search box and hit Search. Then, from the results page, check the Group Formats and Editions checkbox. You'll get an internal server error (and under the hood, it's against the API call open-ils.circ.holds.metarecord.filtered_records). This is a query parser bug in the vein of bug 1174860 but with the #metabib modifier. I don't understand it beyond that. :-)

Mike suggested that bug 1281280 may be a way forward.

Mike Rylander (mrylander) wrote :

Specifically, this is a query construction issue having to do with the explicit boolean pushdown that we do in QueryParser. The most correct solution would really be to use the floating subquery syntax provided by QueryParser for all the query elements that are not user-typed (that is, checkboxes, dropdowns, etc), and gut nearly all of the layers of indirection that exist inside open-ils.search and open-ils.storage. OTTOMH, there are at least three API calls used serially, that are purely there as compatability shims for older search backends.

Once those shims are gone, the tpac should construct QP strings, and retrieve QP query objects for later inspection.

As an example of the floating subquery syntax, consider the filters and modifiers in this search, wrapped in {{}}:

   (title:Piano concerto && author:bartok) {{#metabib sort(authorsort) #available search_format(blu-ray) site(CONS)}}

Wrapping the filters and modifiers in the {{}} syntax protects them from user input.

Mike Rylander (mrylander) wrote :

Here's a branch that addresses the immediate issue. What I describe above is quite invasive, so, baby steps.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp_1310751-query-parser-wrapper-reorder

tags: added: opac pullrequest
Changed in evergreen:
milestone: none → 2.6.1
Dan Wells (dbw2) wrote :

The branch above helps, but doesn't fix every 'Can't call method "source_records" on an undefined value' (as described on bug #1323639). Specifically, a simple search for 'one && two' with "Group Formats" on still breaks in the same way.

Dan Wells (dbw2) on 2014-05-28
Changed in evergreen:
status: New → Confirmed
Dan Wells (dbw2) wrote :

I pushed the linked branch in, but am leaving this open pending a fix for the case listed above (boolean searches with no parentheses).

Changed in evergreen:
milestone: 2.6.1 → 2.next
Kathy Lussier (klussier) on 2014-08-08
tags: removed: pullrequest
no longer affects: evergreen/2.6
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers