[Bug 24902] New: Elasticsearch - different limits are joined with OR instead of AND
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Bug ID: 24902 Summary: Elasticsearch - different limits are joined with OR instead of AND Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com In the advanced search form, you can enable several limits using syspref AdvancedSearchTypes (namely itemtypes, shelving locations, collections). When used, the resulting query parts end up being joined with OR, even if the field is different. That means that if you pick "Book" under itemtypes tab, and "Fiction" under collection tab, it will search "itype:BOOK OR ccode:FIC". It should be AND. For instance, if you select: Itemtypes: ✓ Book ✓ DVD Location: ✓ Child ✓ Adult instead of: itype:Book OR itype:DVD OR location:Child OR location:Adult it should search: itype:(Book OR DVD) AND location:(Child OR Adult) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 101002 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101002&action=edit Bug 24902: Join different mc- limits with AND (elasticsearch) In the advanced search form, you can enable several limits using syspref AdvancedSearchTypes (namely itemtypes, shelving locations, collections) When used, the resulting query parts end up being joined with OR, even if the field is different. That means that if you pick "Book" under itemtypes tab, and "Fiction" under collection tab, it will search "itype:BOOK OR ccode:FIC". It should be AND. For instance, if you select: Itemtypes: ✓ Book ✓ DVD Location: ✓ Child ✓ Adult it should search: itype:(Book OR DVD) AND location:(Child OR Adult) Test plan: 0. Do not apply the patch yet 1. Enable elasticsearch 2. Set syspref AdvancedSearchTypes = 'itemtypes|loc|ccode' 3. Create a new itemtype and a new authorised value for categories LOC and CCODE 4. Create a biblio with the new itemtype, another biblio with the new location, another biblio with the new collection, and again another biblio with the new itemtype, location and collection 5. Verify that you can find these new biblio records using only the "advanced search types" in the advanced search form 6. In the advanced search form, pick all 3 limits (itemtype, location, collection) and verify that it returns the 4 records. 7. Apply the patch 8. Repeat step 6, it should now return only the biblio that satisfies all criteria 9. Verify that if you select more than one {itemtype|location|collection} it still returns results that satisfies any selected criteria 10. prove t/Koha/SearchEngine/ElasticSearch/QueryBuilder.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101002|0 |1 is obsolete| | --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 101353 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101353&action=edit Bug 24902: Join different mc- limits with AND (elasticsearch) In the advanced search form, you can enable several limits using syspref AdvancedSearchTypes (namely itemtypes, shelving locations, collections) When used, the resulting query parts end up being joined with OR, even if the field is different. That means that if you pick "Book" under itemtypes tab, and "Fiction" under collection tab, it will search "itype:BOOK OR ccode:FIC". It should be AND. For instance, if you select: Itemtypes: ✓ Book ✓ DVD Location: ✓ Child ✓ Adult it should search: itype:(Book OR DVD) AND location:(Child OR Adult) Test plan: 0. Do not apply the patch yet 1. Enable elasticsearch 2. Set syspref AdvancedSearchTypes = 'itemtypes|loc|ccode' 3. Create a new itemtype and a new authorised value for categories LOC and CCODE 4. Create a biblio with the new itemtype, another biblio with the new location, another biblio with the new collection, and again another biblio with the new itemtype, location and collection 5. Verify that you can find these new biblio records using only the "advanced search types" in the advanced search form 6. In the advanced search form, pick all 3 limits (itemtype, location, collection) and verify that it returns the 4 records. 7. Apply the patch 8. Repeat step 6, it should now return only the biblio that satisfies all criteria 9. Verify that if you select more than one {itemtype|location|collection} it still returns results that satisfies any selected criteria 10. prove t/Koha/SearchEngine/ElasticSearch/QueryBuilder.t Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works nice, no errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101353|0 |1 is obsolete| | --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 101363 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101363&action=edit Bug 24902: Join different mc- limits with AND (elasticsearch) In the advanced search form, you can enable several limits using syspref AdvancedSearchTypes (namely itemtypes, shelving locations, collections) When used, the resulting query parts end up being joined with OR, even if the field is different. That means that if you pick "Book" under itemtypes tab, and "Fiction" under collection tab, it will search "itype:BOOK OR ccode:FIC". It should be AND. For instance, if you select: Itemtypes: ✓ Book ✓ DVD Location: ✓ Child ✓ Adult it should search: itype:(Book OR DVD) AND location:(Child OR Adult) Test plan: 0. Do not apply the patch yet 1. Enable elasticsearch 2. Set syspref AdvancedSearchTypes = 'itemtypes|loc|ccode' 3. Create a new itemtype and a new authorised value for categories LOC and CCODE 4. Create a biblio with the new itemtype, another biblio with the new location, another biblio with the new collection, and again another biblio with the new itemtype, location and collection 5. Verify that you can find these new biblio records using only the "advanced search types" in the advanced search form 6. In the advanced search form, pick all 3 limits (itemtype, location, collection) and verify that it returns the 4 records. 7. Apply the patch 8. Repeat step 6, it should now return only the biblio that satisfies all criteria 9. Verify that if you select more than one {itemtype|location|collection} it still returns results that satisfies any selected criteria 10. prove t/Koha/SearchEngine/ElasticSearch/QueryBuilder.t Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works nice, no errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24902 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|20.05.00 |20.05.00, 19.11.05 released in| | --- Comment #5 from Joy Nelson <joy@bywatersolutions.com> --- backported to 19.11.x for 19.11.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org