Bug 30153: Use uppercase AND to join query parts
authorThomas Klausner <domm@plix.at>
Tue, 22 Feb 2022 14:09:58 +0000 (15:09 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 2 Mar 2022 08:47:46 +0000 (22:47 -1000)
commit289551282da7209b5394c82c4f310c32ae084499
treebe6840ba1ac0585a0405cb7ca9741a96a6b35cc6
parenta358f5b9ef5b27a809db9fc61b6c957d5db28b92
Bug 30153: Use uppercase AND to join query parts

C4::Search->FindDuplicate joins title and author using 'and'
(lowercase). When this query is passed on to ElasticSearch, it
interprets the lowercase 'and' as a term to search for, because the
operator has to be in uppercases ('AND').

Test plan:
* Reproduce the bug:
- Set SearchEngine to ElasticSearch (and make sure you have the data
  indexed etc)
- Find an existing book, note the title (245a) and the author (100a)
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
  existing book (and any other fields that might be required)
- Click "save"
=> A new book will be created, the Duplicate Finder has failed

* Apply the patch

* Check if it's working now:
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
  existing book (and any other fields that might be required)
- Click "save"
- The DuplicateFinder should now report the already exising book

Maybe we should also check if Zebra does not have any problems with the
uppercase 'AND'? In that case, repeat the above steps, but set
SearchEngine to Zebra :-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Search.pm