Bugzilla – Attachment 3674 Details for
Bug 5651
can't use ? character in searches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
bug_5651.patch (text/plain), 1.36 KB, created by
Jared Camins-Esakov
on 2011-04-05 12:16:35 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2011-04-05 12:16:35 UTC
Size:
1.36 KB
patch
obsolete
>From 343379ef223a4e73d375852af8937d169503bd58 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@bywatersolutions.com> >Date: Sun, 3 Apr 2011 08:17:13 -0400 >Subject: [PATCH] Bug 5651: Question marks break searches w/ICU >Content-Type: text/plain; charset="UTF-8" > >When a user is doing a simple keyword search, they should not be expected to >deal with the magical behavior of question marks in Zebra. This fix escapes >question marks, and reduces the number of false positives for identifying a >"simple keyword search." >--- > C4/Search.pm | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index b8939b6..df8e946 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1120,10 +1120,12 @@ sub buildQuery { > my $indexes_set; > > # If the user is sophisticated enough to specify an index, turn off field weighting, stemming, and stopword handling >- if ( $operands[$i] =~ /(:|=)/ || $scan ) { >+ if ( $operands[$i] =~ /\w(:|=)/ || $scan ) { > $weight_fields = 0; > $stemming = 0; > $remove_stopwords = 0; >+ } else { >+ $operands[$i] =~ s/\?/{?}/g; # need to escape question marks > } > my $operand = $operands[$i]; > my $index = $indexes[$i]; >-- >1.7.2.3 >
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 5651
: 3674