Bug 27928 - FindDuplicate is hardcoded to use Zebra
Summary: FindDuplicate is hardcoded to use Zebra
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 30153
  Show dependency treegraph
 
Reported: 2021-03-11 13:34 UTC by Nick Clemens
Modified: 2022-12-12 21:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11


Attachments
Bug 27928: FindDuplicate shuold use simple_search_compat (4.33 KB, patch)
2021-03-11 13:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27928: FindDuplicate shuold use simple_search_compat (4.39 KB, patch)
2021-03-22 10:24 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 27928: FindDuplicate shuold use simple_search_compat (4.38 KB, patch)
2021-03-25 14:42 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-03-11 13:34:32 UTC
There is a fixme in the code, we should use 'simple_search_compat'
Comment 1 Nick Clemens 2021-03-11 13:41:42 UTC
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
Comment 2 Fridolin Somers 2021-03-22 10:24:54 UTC
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>
Comment 3 Fridolin Somers 2021-03-22 10:25:55 UTC
Works perfect with both engines.
Comment 4 Martin Renvoize 2021-03-25 14:42:18 UTC
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>
Comment 5 Martin Renvoize 2021-03-25 14:43:14 UTC
Clear and simple fix, works as expected, no regressions found.

Passing QA
Comment 6 Jonathan Druart 2021-04-01 16:54:40 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-04-13 14:53:10 UTC
Pushed to 20.11.x for 20.11.05
Comment 8 Andrew Fuerste-Henry 2021-04-24 13:55:24 UTC
Pushed to 20.05.x for 20.05.11
Comment 9 Victor Grousset/tuxayo 2021-04-24 16:50:27 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.
Comment 10 David Cook 2021-07-20 03:12:59 UTC
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...