Bug 24109 - Elasticsearch - Advanced search limit by shelving location is not converted to correct index
Summary: Elasticsearch - Advanced search limit by shelving location is not converted t...
Status: RESOLVED DUPLICATE of bug 22426
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Nick Clemens (kidclamp)
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-26 02:18 UTC by Myka Kennedy Stephens
Modified: 2020-06-26 10:58 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 24109: Map 'loc' to 'location' whne building ES queries (1.46 KB, patch)
2019-12-24 14:47 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 24109: Map 'loc' to 'location' whne building ES queries (1.53 KB, patch)
2019-12-25 19:18 UTC, Myka Kennedy Stephens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Myka Kennedy Stephens 2019-11-26 02:18:49 UTC
When performing an advanced catalog search, the limits for item type and collection are formed into a query string with OR, while the limits for shelving location are formed into the query string with AND. This prevents searching multiple locations at once and is also confusing since the behavior is different from the other limit tabs and is accompanied by the same instruction, "Limit to any of the following."

Steps to replicate:
1. In the advanced catalog search, select two limits on the item types tab.  Perform search. Note the search query was constructed with OR.
2. Return to the advanced catalog search and clear fields. Select two limits on the shelving location tab. Perform search. Note the search query was constructed with AND.
3. Return to the advanced catalog search and clear fields. Select two limits on the collections tab. Perform search. Note the search query was constructed with OR.
Comment 1 Nick Clemens (kidclamp) 2019-12-24 14:47:15 UTC
Created attachment 96623 [details] [review]
Bug 24109: Map 'loc' to 'location' whne building ES queries

When building the query we start with mc-loc - then we strip the mc, convert the field, and restore mc-
to indicate the searches should be ORed together.

We have a mapping for mc-loc to location, but we strip the mc for converting

For all other mc indexes there is no issue as they don't need to be mapped (they are the same minus the mc)

To test:
0 - Be using Elasticsearch and have  AdvancedSearchTypes set to include loc
1 - Perform an advanced search for two shelving locations that have items in the catalog
2 - Note no restuls
3 - Apply patch
4 - Restart all the things
5 - Repeat search
6 - You get results!
Comment 2 Myka Kennedy Stephens 2019-12-25 19:18:31 UTC
Created attachment 96628 [details] [review]
Bug 24109: Map 'loc' to 'location' whne building ES queries

When building the query we start with mc-loc - then we strip the mc, convert the field, and restore mc-
to indicate the searches should be ORed together.

We have a mapping for mc-loc to location, but we strip the mc for converting

For all other mc indexes there is no issue as they don't need to be mapped (they are the same minus the mc)

To test:
0 - Be using Elasticsearch and have  AdvancedSearchTypes set to include loc
1 - Perform an advanced search for two shelving locations that have items in the catalog
2 - Note no restuls
3 - Apply patch
4 - Restart all the things
5 - Repeat search
6 - You get results!

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Comment 3 Myka Kennedy Stephens 2019-12-25 19:19:13 UTC
Patch works as expected. Thank you!
Comment 4 Nick Clemens (kidclamp) 2020-01-10 14:13:57 UTC
Same issue as on 22426

*** This bug has been marked as a duplicate of bug 22426 ***