Bugzilla – Attachment 113935 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), 1.93 KB, created by
Nick Clemens (kidclamp)
on 2020-11-23 18:45:23 UTC
(
hide
)
Description:
Bug 26957: Don't remove words that are also operators from search terms
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-11-23 18:45:23 UTC
Size:
1.93 KB
patch
obsolete
>From 5e80ce05865967eb7e5c34c09600a9fb8d73144d 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 >--- > C4/Search.pm | 5 ----- > 1 file changed, 5 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index f2e73ee5a4..4b46856c40 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.11.0
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