Bugzilla – Attachment 5251 Details for
Bug 6786
False detection of index names in Search; make index names case insensitive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed-off patch
0001-SIGNED-OFF-6786-False-detection-of-index-names-in-Se.patch (text/plain), 1.79 KB, created by
Frédéric Demians
on 2011-09-01 12:04:25 UTC
(
hide
)
Description:
Signed-off patch
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2011-09-01 12:04:25 UTC
Size:
1.79 KB
patch
obsolete
>From 04473f2aadecff963ed248fd6684e3acc8bb07f3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 25 Aug 2011 13:12:38 +0200 >Subject: [PATCH] [SIGNED-OFF] 6786: False detection of index names in Search; > make index names case insensitive >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Fixing the regex to detect index names in ccl queries. Changing loop >structure: looping through the index candidates in the query is faster than >testing every index name with a regex. Making the index comparison case >insensitive will benefit users misspelling the case of an index; Zebra does not >care about it. Test the change by searching on a word followed by a : or = >character. Previously, when that word contained an index name like an or nb, >the search would crash. > >Signed-off-by: Frédéric Demians <f.demians@tamil.fr> >--- > C4/Search.pm | 15 +++++++-------- > 1 files changed, 7 insertions(+), 8 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index c3cff65..e16772d 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1071,15 +1071,14 @@ sub buildQuery { > > my $stopwords_removed; # flag to determine if stopwords have been removed > >- my $cclq; >+ my $cclq=0; > my $cclindexes = getIndexes(); >- if( $query !~ /\s*ccl=/ ){ >- for my $index (@$cclindexes){ >- if($query =~ /($index)(,?\w)*[:=]/){ >- $cclq = 1; >- } >- } >- $query = "ccl=$query" if($cclq); >+ if( $query !~ /\s*ccl=/ ) { >+ while(!$cclq && $query=~/(?:^|\W)(\w+)(,\w+)*[:=]/g) { >+ my $dx=lc($1); >+ $cclq= grep {lc($_) eq $dx} @$cclindexes; >+ } >+ $query = "ccl=$query" if $cclq; > } > > # for handling ccl, cql, pqf queries in diagnostic mode, skip the rest of the steps >-- >1.7.6.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 6786
:
5145
|
5251
|
6572
|
6573