]> git.koha-community.org Git - koha.git/commit
Bug 26957: Don't remove words that are also operators from search terms
authorNick Clemens <nick@bywatersolutions.com>
Mon, 23 Nov 2020 18:37:48 +0000 (18:37 +0000)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 29 Jan 2021 14:25:23 +0000 (14:25 +0000)
commit7ab5051e09bab8f5654fb9ef102f03ebe6528bb1
treef8bcc49a203af8267fac238070467cf5029f7e74
parent1b076fcf1e485b890e5c8d7c3ad2c0a8924b0311
Bug 26957: Don't remove words that are also operators from search terms

FindDuplicate has a hardcoded regex to remove 'and', 'or', and 'not' from any search fields, however,
is does this with no regard for these terms being embedded in the middle of a word or phrase.

E.g.:
'Coupland' becomes 'Coupl'
'Frog and toad' becomes 'frog toad'
etc.

This patch simplay removes the substitutions as we already quote the terms as well

To test:
1 - Add records to your system like:
    The night circus by Erin Morgenstern
    Frog and toad all year
    Nothing ever happens
2 - Attempt to add purchase suggestions like
    title: the night circus, author:Morgenstern, Erin
    title: For and toad all year
    title:nothing ever happens (case is important)
3 - No warnings about existing biblios
4 - Apply patches
5 - Delete existing suggestions
6 - Repeat step 2
7 - Each attempt should warn you of existing biblio

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a52a9d787544aae384aee1a33c9d3bb35d98f8fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 680fc0f77d9c7c3c20dacc14c9db94b52d009ee4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
C4/Search.pm