Summary: | "Keyword as phrase" option in search dropdown doesn't work with Elastic | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | Searching - Elasticsearch | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, fridolin.somers, martin.renvoize, nick, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24895 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
21.05.00,20.11.02,20.05.09
|
Circulation function: | |
Attachments: |
Bug 27307: Unit test
Bug 27307: Don't drop phrase directive when searching keyword index Bug 27307: Unit test Bug 27307: Don't drop phrase directive when searching keyword index Bug 27307: Unit test Bug 27307: Don't drop phrase directive when searching keyword index |
Description
Andrew Fuerste-Henry
2020-12-24 13:29:58 UTC
Created attachment 114699 [details] [review] Bug 27307: Unit test Created attachment 114700 [details] [review] Bug 27307: Don't drop phrase directive when searching keyword index We convert 'keyword' to '' as an index since we want it to search all fields When we are searching 'as phrase', however, we should not drop the search type To test: 1 - Enable IntranetCatalogPullDown 2 - Set searchEngine to Elasticsearch 3 - Perform a search for 'Keyword as phrase' for a phrase that does appear in a record 4 - You get the result 5 - Reverse the order of words in the phrase 6 - You still get a result? 7 - Apply patch 8 - Restart all the things 9 - Reversed search does not return record 10 - Correct order and search, correct record returned Created attachment 114701 [details] [review] Bug 27307: Unit test Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Created attachment 114702 [details] [review] Bug 27307: Don't drop phrase directive when searching keyword index We convert 'keyword' to '' as an index since we want it to search all fields When we are searching 'as phrase', however, we should not drop the search type To test: 1 - Enable IntranetCatalogPullDown 2 - Set searchEngine to Elasticsearch 3 - Perform a search for 'Keyword as phrase' for a phrase that does appear in a record 4 - You get the result 5 - Reverse the order of words in the phrase 6 - You still get a result? 7 - Apply patch 8 - Restart all the things 9 - Reversed search does not return record 10 - Correct order and search, correct record returned Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Created attachment 115077 [details] [review] Bug 27307: Unit test Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 115078 [details] [review] Bug 27307: Don't drop phrase directive when searching keyword index We convert 'keyword' to '' as an index since we want it to search all fields When we are searching 'as phrase', however, we should not drop the search type To test: 1 - Enable IntranetCatalogPullDown 2 - Set searchEngine to Elasticsearch 3 - Perform a search for 'Keyword as phrase' for a phrase that does appear in a record 4 - You get the result 5 - Reverse the order of words in the phrase 6 - You still get a result? 7 - Apply patch 8 - Restart all the things 9 - Reversed search does not return record 10 - Correct order and search, correct record returned Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works well, includes tests.. Passing QA Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.02 Pushed to 20.05.x for 20.05.09 Pushed to 20.05.x for 20.05.09 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |