[Bug 30173] New: The suppress limit breaks the OPAC adv search using OR
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30173 Bug ID: 30173 Summary: The suppress limit breaks the OPAC adv search using OR Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: philippe.blouin@inlibro.com When using the advanced search, it is possible to specify an OR (instead of the default AND) between the terms. In the OPAC, the system preferences OpacSuppression will add a limit to every search as "suppress:false". The problem is that the limit is simply added as "AND suppress:false" to the query, without validating if it makes sense. In the case of OR searches, it does not: (title:PuttingHarry) OR (title:HarryPutter) AND suppress:false will not produce the desired results. -- 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=30173 --- Comment #1 from Blou <philippe.blouin@inlibro.com> --- Created attachment 131050 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131050&action=edit Bug 30173: The suppress limit breaks the OPAC adv search using OR When using the advanced search, it is possible to specify an OR (instead of the default AND) between the terms. In the OPAC, the system preferences OpacSuppression will add a limit to every search as "suppress:false". The problem is that the limit is simply added as "AND suppress:false" to the query, without validating if it makes sense. In the case of OR searches, it does not: (title:PuttingHarry) OR (title:HarryPutter) AND suppress:false will not produce the desired results. This fix (suggested by Kevin Carnes) makes sure to envelop the search terms before padding the AND suppress:false. To test: 1) Create two records with very distinctive titles, and prove that search one by title only return that one result. Same for the other. 2) Modify the OpacSuppression syspref to select "Hide" 3) Turn ON the ES tracing by editing koha-conf.xml and adding <trace_to>Stderr</trace_to> under elasticsearch. That will allow you to see the strings generated. 4) Go to the advsearch in OPAC, do an OR search for both titles. In your logs, you should see something like "query" : "(title:TITLE1) OR (title:TITLE2) AND suppress:false" and get only one result. 5) Apply the patch, run again, this time the log should show "query" : "((title:TITLE1) OR (title:TITLE2)) AND suppress:false" and return two results. -- 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=30173 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |philippe.blouin@inlibro.com |ity.org | Patch complexity|--- |Small patch Status|NEW |Needs Signoff --- Comment #2 from Blou <philippe.blouin@inlibro.com> --- This occurs in 20.05+ with Elastic Search. -- 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=30173 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30141 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30173 Kevin Carnes <kevin.carnes@ub.lu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kevin.carnes@ub.lu.se Status|Needs Signoff |RESOLVED Resolution|--- |DUPLICATE --- Comment #3 from Kevin Carnes <kevin.carnes@ub.lu.se> --- *** This bug has been marked as a duplicate of bug 30152 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30173 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org