Summary: | When performing a basic search with no results, repeat the search with term quoted | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Searching | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andrew, caroline.cyr-la-rose, dcook, fridolin.somers, joonas.kylmala, lucas, martin.renvoize, sally.healey, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1091 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33406 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This enhancement adds a second, automatic, search with the search terms between quotation marks when a search returns no results.
For example, searches with special characters don't work with Elasticsearch.
A search for Ivy + Bean will return no results. But a search for "Ivy + Bean" will return results.
With this enhancement, if a user searches for Ivy + Bean without quotation marks and gets no results, Koha will automatically search for "Ivy + Bean" and return those results.
This targets both Zebra and Elasticsearch, but is more relevant for Elasticsearch.
|
Version(s) released in: |
22.11.00,22.05.05,21.11.12
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 32100 | ||
Attachments: |
Bug 31213: Auto search simple term quoted
Bug 31213: Auto search simple term quoted Bug 31213: Auto search simple term quoted |
Description
Nick Clemens (kidclamp)
2022-07-21 18:16:12 UTC
Created attachment 137993 [details] [review] Bug 31213: Auto search simple term quoted This patch does a second search if the first had no results and was a simple single term search We simply quote the term, rebuild the query, and rerun the search This targets both Zebra and ES, but is more relevant for ES To test: 0 - Have Koha running using ES 1 - Add titles your system "Ivy + Bean" "The 6:20 Man" 2 - Search for these titles without quotes - NO results under ES 3 - Search with quotes - you find them 4 - Apply patch, restart all 5 - Search again without quotes 6 - Success! 7 - Confirm search still works under Zebra Created attachment 138002 [details] [review] Bug 31213: Auto search simple term quoted This patch does a second search if the first had no results and was a simple single term search We simply quote the term, rebuild the query, and rerun the search This targets both Zebra and ES, but is more relevant for ES To test: 0 - Have Koha running using ES 1 - Add titles your system "Ivy + Bean" "The 6:20 Man" 2 - Search for these titles without quotes - NO results under ES 3 - Search with quotes - you find them 4 - Apply patch, restart all 5 - Search again without quotes 6 - Success! 7 - Confirm search still works under Zebra Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Works great, thanks Nick - signed off. Great idea Created attachment 138004 [details] [review] Bug 31213: Auto search simple term quoted This patch does a second search if the first had no results and was a simple single term search We simply quote the term, rebuild the query, and rerun the search This targets both Zebra and ES, but is more relevant for ES To test: 0 - Have Koha running using ES 1 - Add titles your system "Ivy + Bean" "The 6:20 Man" 2 - Search for these titles without quotes - NO results under ES 3 - Search with quotes - you find them 4 - Apply patch, restart all 5 - Search again without quotes 6 - Success! 7 - Confirm search still works under Zebra Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works as described and the QA scripts are happy.. I wondered if we could possibly move it up a level into the modules but decided that's either a silly idea, or something for a future piece.. Passing QA +1 from me as well. Pushed to master for 22.11. Nice work everyone, thanks! This sounds so hacky but if it works... (In reply to David Cook from comment #9) > This sounds so hacky but if it works... We often have libraries with callnumbers containing special characters (most of our libraries use custom classifications) like ( ) [] etc. that make an unquoted search return nothing. So I think this will prove helpful. Quoting right away would take the ability to truncate etc. away, but as a second step it makes sense. (In reply to Katrin Fischer from comment #10) > (In reply to David Cook from comment #9) > > This sounds so hacky but if it works... > > We often have libraries with callnumbers containing special characters (most > of our libraries use custom classifications) like ( ) [] etc. that make an > unquoted search return nothing. So I think this will prove helpful. > > Quoting right away would take the ability to truncate etc. away, but as a > second step it makes sense. I'm happy to agree to disagree when it comes to search :) Backported to 22.05.x for 22.05.05 Thanks! Pushed to 21.11 for 21.11.12 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. This is super great :D This seems like a backend change. There is no effect on the manual, that I can see. |