Bugzilla – Attachment 115080 Details for
Bug 26957
Find duplicate removes operators from the middle of search terms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26957: Don't remove words that are also operators from search terms
Bug-26957-Dont-remove-words-that-are-also-operator.patch (text/plain), 2.06 KB, created by
Martin Renvoize (ashimema)
on 2021-01-12 12:18:50 UTC
(
hide
)
Description:
Bug 26957: Don't remove words that are also operators from search terms
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-01-12 12:18:50 UTC
Size:
2.06 KB
patch
obsolete
>From e9cb3483909a41fdb56b9115b32c7a3c1646cba5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 23 Nov 2020 18:37:48 +0000 >Subject: [PATCH] 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> >--- > C4/Search.pm | 5 ----- > 1 file changed, 5 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 811e6c1809..864d4bd11b 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -107,9 +107,6 @@ sub FindDuplicate { > $result->{title} =~ s /\(//g; > $result->{title} =~ s /\)//g; > >- # FIXME: instead of removing operators, could just do >- # quotes around the value >- $result->{title} =~ s/(and|or|not)//g; > $query = "$titleindex:\"$result->{title}\""; > if ( $result->{author} ) { > $result->{author} =~ s /\\//g; >@@ -117,8 +114,6 @@ sub FindDuplicate { > $result->{author} =~ s /\(//g; > $result->{author} =~ s /\)//g; > >- # remove valid operators >- $result->{author} =~ s/(and|or|not)//g; > $query .= " $op $authorindex:\"$result->{author}\""; > } > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26957
:
113933
|
113934
|
113935
|
113936
|
114716
|
115079
| 115080