Bug 20099 - Filtering by Library returns incorrect results
Summary: Filtering by Library returns incorrect results
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Zebra (show other bugs)
Version: Main
Hardware: All All
: P2 major
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 10:37 UTC by Daphne Hoolahan
Modified: 2020-11-30 21:45 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Crowdfunding committed: 0
Crowdfunding contact:
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 20099: Try exact search for facets (760 bytes, patch)
2019-12-11 10:49 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Daphne Hoolahan 2018-01-30 10:37:52 UTC
I have 3 libraries; AB; AB_C and AB_D
If I Refine Search for Holding Library AB_C I get the correct results, all biblios which have at least one item in AB_C; similarly for Holding Library AB_D but if I Refine Search for Holding Library AB I get all biblios which have at least one item in AB, or AB_C or AB_D.
The system is treating AB_C and AB_D as subsets of AB but AB_C is a completely different value to AB.
The problem is the same in the staff interface.
Comment 1 Jonathan Druart 2018-01-30 20:42:37 UTC
I have just tested quickly, I have a branchcode "CPL", I search for "d" and use the CPL facet. I get 240 results and the url is
http://pro.kohadev.org/cgi-bin/koha/catalogue/search.pl?idx=kw&q=d&sort_by=relevance_dsc&limit=holdingbranch:CPL

If I replace CPL with CP, I get the "no result" page

Do you recreate this issue on a sandbox?
Comment 2 Katrin Fischer 2018-01-30 20:50:17 UTC
I think the issue is the underscore. My guess is that Zebra treats it as a space, so you end up with Zebra treating AB_D and AB_C as 2 words. When doing a keyword search or limit on AB it will then naturally return the records from all branches with the 'word' AB.

My normal advice is: never use spaces or underscores or - in your codes (library, itemtype, locatio, collection, ...) in Koha, because of how Zebra will treat them. Sometimes you might want that behaviour, but other times it's really not helpful.
Comment 3 Jonathan Druart 2019-12-11 10:21:16 UTC
This is Zebra only (works ok with elastic)
Comment 4 Jonathan Druart 2019-12-11 10:49:30 UTC
Created attachment 96185 [details] [review]
Bug 20099: Try exact search for facets
Comment 5 Jonathan Druart 2019-12-11 10:50:26 UTC
So this patch does not work as "ext" is not supported if ICU is enabled.

The only thing is then to either use elastic, or modify the branchcodes :)