[Bug 37333] New: Search filters using OR are not correctly grouped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Bug ID: 37333 Summary: Search filters using OR are not correctly grouped Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org When a search filter contains terms joined by OR: subject:programming OR subject:internet The search filter is added to a search like: title:perl AND subject:programming OR subject:internet This negates the full effect of the filter as it is not considered as a single part -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168864 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168864&action=edit Bug 37333: Group search terms in a saved filter This patch surrounds the expanded query of a search filter in parnetheses to correctly group the terms when searching To test: 1 - Enable system preference SavedSearchFilters 2 - In staff client, perform an advanced search for: subject:internet OR subject:programming 3 - Note results 4 - Save search as filter, enabled in staff client and opac 5 - Search for 'a' 6 - Apply filter from top of facets on left hand side 7 - Note results didn't change 8 - Apply patch, restart all 9 - Reload search, it now limits correctly 10 - Test on OPAC 11 - Test on both Zebra and Elastic 12 - Sign off :-) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Jake Deery <jake.deery@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168864|0 |1 is obsolete| | --- Comment #2 from Jake Deery <jake.deery@ptfs-europe.com> --- Created attachment 168894 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168894&action=edit Bug 37333: Group search terms in a saved filter This patch surrounds the expanded query of a search filter in parnetheses to correctly group the terms when searching To test: 1 - Enable system preference SavedSearchFilters 2 - In staff client, perform an advanced search for: subject:internet OR subject:programming 3 - Note results 4 - Save search as filter, enabled in staff client and opac 5 - Search for 'a' 6 - Apply filter from top of facets on left hand side 7 - Note results didn't change 8 - Apply patch, restart all 9 - Reload search, it now limits correctly 10 - Test on OPAC 11 - Test on both Zebra and Elastic 12 - Sign off :-) Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Jake Deery <jake.deery@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jake.deery@ptfs-europe.com Status|Needs Signoff |Signed Off --- Comment #3 from Jake Deery <jake.deery@ptfs-europe.com> --- Hi Nick, All looks good to me. I can see before vs. after on the results page: - 11 result(s) found for 'kw,wrdl: a' with limit(s): 'and su=(internet) OR su=(programming)'. + 11 result(s) found for 'kw,wrdl: a' with limit(s): 'and (su=(internet) OR su=(programming))'. … and the results do change, now closer to what I think is correct, and definitely in a more concice order. Probably need a search nerd to QA this, but for now, here is my sign-off, with thanks! Jake -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168894|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 169099 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169099&action=edit Bug 37333: Group search terms in a saved filter This patch surrounds the expanded query of a search filter in parnetheses to correctly group the terms when searching To test: 1 - Enable system preference SavedSearchFilters 2 - In staff client, perform an advanced search for: subject:internet OR subject:programming 3 - Note results 4 - Save search as filter, enabled in staff client and opac 5 - Search for 'a' 6 - Apply filter from top of facets on left hand side 7 - Note results didn't change 8 - Apply patch, restart all 9 - Reload search, it now limits correctly 10 - Test on OPAC 11 - Test on both Zebra and Elastic 12 - Sign off :-) Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks Nick, patch I see is trivial, but it's great to see the mammoth set to unit tests to go with it. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Unit tests! \o/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |januszop@gmail.com --- Comment #8 from Janusz Kaczmarek <januszop@gmail.com> --- It seems that after applying this patch the test: t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t fails :( The patch adds an additional level of parentheses which in turn makes "Handle search filters" section fail in 4 subtests. Could you confirm this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Correct; I've already asked Nick to take a look. My hunch is that it's OK and we just need to update the tests, but i wanted him to confirm that before I went ahead and did that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 --- Comment #10 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Martin Renvoize from comment #9)
My hunch is that it's OK and we just need to update the tests, but i wanted him to confirm that before I went ahead and did that.
Yes, I agree, this is probably just about updating the test patterns. Now this stops my playing around with QueryBuilder.t ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 169308 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169308&action=edit Bug 37333: (follow-up) Update existing tests We add a level of bracket nesting. I checked with Nick that this shouldn't cause any issues in the queries and we agreed it made sense so I've gone ahead and updated the tests to reflect the change. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00 |24.11.00,24.05.06 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to main |Pushed to stable --- Comment #12 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00,24.05.06 |24.11.00,24.05.06,23.11.11 released in| | Status|Pushed to oldstable |Pushed to oldoldstable CC| |fridolin.somers@biblibre.co | |m --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37333 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldoldstable |Needs documenting --- Comment #14 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org