There is a fixme in the code, we should use 'simple_search_compat'
Created attachment 118120 [details] [review] Bug 27928: FindDuplicate shuold use simple_search_compat This patch switches from calling SimpleSearch directly to using the compat method so that Elastic is used when it is the chosen search engine To test: 1 - Set SearchEngine syspref to 'Zebra' 2 - Add a suggestion with an existing title, e.g.: 'E street shuffle' 3 - Confirm you get a duplication warning 4 - Change SearchEngine to ES 5 - Repeat get same warning 6 - sudo koha-zebra --stop 'ps aux | grep zebra' to confirm they are stoped 'sudo pkill -9 zebra' if they arent; 7 - Repeat suggestion - no duplication warning (because zebra returns nothing) 8 - Delete the suggestion 9 - Apply patches 10 - Restart all the things, stop zebra 11 - Repeat suggestion 12 - Successful warning from ES 13 - prove -v t/db_dependent/Search.t
Created attachment 118577 [details] [review] Bug 27928: FindDuplicate shuold use simple_search_compat This patch switches from calling SimpleSearch directly to using the compat method so that Elastic is used when it is the chosen search engine To test: 1 - Set SearchEngine syspref to 'Zebra' 2 - Add a suggestion with an existing title, e.g.: 'E street shuffle' 3 - Confirm you get a duplication warning 4 - Change SearchEngine to ES 5 - Repeat get same warning 6 - sudo koha-zebra --stop 'ps aux | grep zebra' to confirm they are stoped 'sudo pkill -9 zebra' if they arent; 7 - Repeat suggestion - no duplication warning (because zebra returns nothing) 8 - Delete the suggestion 9 - Apply patches 10 - Restart all the things, stop zebra 11 - Repeat suggestion 12 - Successful warning from ES 13 - prove -v t/db_dependent/Search.t Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Works perfect with both engines.
Created attachment 118816 [details] [review] Bug 27928: FindDuplicate shuold use simple_search_compat This patch switches from calling SimpleSearch directly to using the compat method so that Elastic is used when it is the chosen search engine To test: 1 - Set SearchEngine syspref to 'Zebra' 2 - Add a suggestion with an existing title, e.g.: 'E street shuffle' 3 - Confirm you get a duplication warning 4 - Change SearchEngine to ES 5 - Repeat get same warning 6 - sudo koha-zebra --stop 'ps aux | grep zebra' to confirm they are stoped 'sudo pkill -9 zebra' if they arent; 7 - Repeat suggestion - no duplication warning (because zebra returns nothing) 8 - Delete the suggestion 9 - Apply patches 10 - Restart all the things, stop zebra 11 - Repeat suggestion 12 - Successful warning from ES 13 - prove -v t/db_dependent/Search.t Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Clear and simple fix, works as expected, no regressions found. Passing QA
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.05
Pushed to 20.05.x for 20.05.11
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.
I think this may have inadvertently fixed Bug 24562. In theory, the max results could be 1 instead of 50, since all the code that uses FindDuplicate only ever takes the 1st result, but I suppose you never know...