[Bug 27088] New: Searching with just OR or AND gives error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27088 Bug ID: 27088 Summary: Searching with just OR or AND gives error Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: joonas.kylmala@helsinki.fi If you search in intranet with elasticsearch just the string
OR
or
AND
Then Koha gives error:
Error: Unable to perform your search. Please try again.
What I was expecting: no results found. -- 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=27088 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- 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=27088 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27088 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I am seeing: /cgi-bin/koha/catalogue/search.pl?q=OR No results found No results match your search for 'kw,wrdl: OR'. /cgi-bin/koha/catalogue/search.pl?q=AND No results found No results match your search for 'kw,wrdl: AND'. -- 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=27088 --- Comment #2 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- (In reply to Jonathan Druart from comment #1)
I am seeing:
/cgi-bin/koha/catalogue/search.pl?q=OR No results found
Which Elasticsearch version you are using and are you using koha-testing-docker? I created the koha-testing-docker with
docker-compose -f docker-compose.yml -f docker-compose.mariadb_latest.yml -f docker-compose.es6.yml -p koha up --force-recreate
and then run
koha-elasticsearch --rebuild -d kohadev
and then in systempreferences I changed searchengine to Elasticsearch. After that doing the AND or OR search it gives error. -- 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=27088 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Sorry, something wrong on my side, Zebra was set (I am not used to check that, I setup my ktd with ES). I do recreate the problem. -- 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=27088 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- IMO we should keep this behaviour. The query has not a correct syntax and so it makes more sense to tell the user that there was an error than no results were found. -- 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=27088 --- Comment #5 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- (In reply to Jonathan Druart from comment #4)
IMO we should keep this behaviour. The query has not a correct syntax and so it makes more sense to tell the user that there was an error than no results were found.
In that case we should treat this as invalid query and notify the user along the lines "The search cannot be processed because of invalid usage of OR/AND." and don't don't even send the query to Elasticsearch. Now there is unhandled error coming from Elasticsearch which makes it then impossible to spot real system errors. This bug can also be triggered with "something OR". With this "something OR" case it might be more desirable to just search for "something" or then convert OR to lower case and search for "something or" ? -- 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=27088 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- IMO it's not a good idea to parse the query for such problems before we sent it to ES. We should request ES and eventually provide feedback to the user about why their query might have been syntactically wrong. -- 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=27088 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #6)
IMO it's not a good idea to parse the query for such problems before we sent it to ES. We should request ES and eventually provide feedback to the user about why their query might have been syntactically wrong.
Agreed. Putting too much query parsing into Koha has gotten us into trouble in the past. -- 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=27088 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #6)
IMO it's not a good idea to parse the query for such problems before we sent it to ES. We should request ES and eventually provide feedback to the user about why their query might have been syntactically wrong.
I'm sure it's probably a duplicate but I've raised Bug 27139 about showing users that there has been a search query error. That being said... you can type gibberish into Google and Google will never tell you that you have a syntax error. (Although I just tried doing an "any of these words" advanced search in Google using "miniature OR" and it created a search query for "miniature OR OR" so even Google is a bit buggy / incorrectly documented when it comes to complex search.) (Typing '"urban keith" and "pickles"' into Google without the single quotes also gives different results to what I'd expect. I want to know about Urban Keith and not Keith Urban, although it seems that Google thinks I've made a typo.) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org