Search queries containing a filter in a subquery/group may drop the filter

Bug #1808055 reported by Jeff Godin
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Undecided
Mike Rylander

Bug Description

Observed in Evergreen 3.1:

When a search query contains a filter in a subgroup, such as:

History (locations(123)), the location filter is dropped.

Performing the search as History locations(123) works as expected.

This seems to be the case for all non-dynamic filters. Dynamic filters such as audience() appear to be unaffected.

Similarly, if a search filter group entry is "locations(123)", a search like the following fails, because it is expanded to a query similar to the problematic one above:

search_group_entry(321) History

Further conversation on IRC: http://irc.evergreen-ils.org/evergreen/2018-12-11#i_387759

Issue seems to be within QueryParser, Mike Rylander has a suggested fix.

Tags: search
Revision history for this message
Mike Rylander (mrylander) wrote :

I've pushed an untested attempt to address this to http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp-1808055-support_nested_static_filters for others to look at. If I can find the tuits to test soon, I will, but please grab if you're interested. I'll not add a pullrequest tag until someone gives it a spin.

Revision history for this message
Jeff Godin (jgodin) wrote :

Thanks, Mike. I gave your branch a try and it did not appear to make a difference in catalog searches or when using query_parser.pl

Is there any particular debug information that would be useful to you?

Jeff Godin (jgodin)
tags: added: search
Changed in evergreen:
status: New → Confirmed
Revision history for this message
John Merriam (jmerriam) wrote :

Hello. This issue causes our custom KPAC search filter (uses copy locations) to stop working after our Evergreen upgrade from 2.12.12 to 3.1.8. We did a bunch of testing in Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm

We could definitely be wrong but it seems like the flatten function does not return data correctly to the toSQL function.

If we bypass the flatten function for the locations filter and add it to the @{$$flat_plan{vis_filter}{'c_attr'}} array in the toSQL function, our KPAC search filter works correctly again.

We tried a bunch of things to figure out what the real problem was and fix it but we decided to go with this nasty hack for now so we can focus on other issues after our recent Evergreen upgrade.

I am attaching a patch that shows what we have done. It is ONLY to illustrate what we have done for developers. DO NOT USE THIS PATCH!

Revision history for this message
Mike Rylander (mrylander) wrote :

I've pulled out a patch from another branch that I've been working on, because I believe it will address the issue on this bug. You can find the branch containing the relevant patch at:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp-1808055-pull_up_filters_facets_modifiers

and any testing would be greatly appreciated.

Revision history for this message
Jeff Godin (jgodin) wrote :

Thanks, Mike. I'm looking at this again and I'm not sure if I've tested your latest branch. I'll make plans to do so this week or next.

In the meantime, is there anything new or noteworthy related to this since your last update?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.