Bugzilla – Attachment 18191 Details for
Bug 10271
An index containing ns or nb does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-10271-An-index-containing-ns-or-nb-does-not-work.patch (text/plain), 2.81 KB, created by
Fridolin Somers
on 2013-05-17 12:43:36 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-05-17 12:43:36 UTC
Size:
2.81 KB
patch
obsolete
>From 0edee1419e159886bf175b21d369483ccd3ed650 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Fri, 17 May 2013 14:03:37 +0200 >Subject: [PATCH] Bug 10271 - An index containing ns or nb does not work > >When an index does not contain a structure part, the structure "wrdl" is automatically added and a structure is mandatory to build search query (to convert ':' into '='). >But the code that tests that the structure is not already defined looks in entire index string : > $index =~ /(st-|phr|ext|wrdl|nb|ns)/ >It should look for a comma followed by a structure and in the case of "nb" and "ns" look for an exact match. >The consequence is that an index containing ns or nb or phr or etc does not work. > >This patch modifies the regexp for this part and other parts looking at structures into index. > >Test plan : >- Desactivate all searching sysprefs. >- Create a new index called "ansa" number 8999 into bib1.att, ccl.properties and records.abs >- Index a biblio with a value on this index, ie "VALUE" >- Perform a search on this index by editing url : http://<server>/cgi-bin/koha/catalogue/search.pl?idx=ansa&q=VALUE >=> Without patch, the search does not work. The PQF query is "@and ansa: VALUE" >=> With patch, the search works. The PQF query is "@attr 1=8999 VALUE"; >- Perform same test with an index containing a structure ie "aphra" >- Set QueryAutoTruncate syspref to automatically >=> Check * is added to operand : PQF query is "@attr 1=8999 @attr 4=6 @attr 5=1 VALUE" >- You may check stopwords removal but this feature is obsolete >--- > C4/Search.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index aec024b..9c03cc6 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -751,7 +751,7 @@ sub _remove_stopwords { > my @stopwords_removed; > > # phrase and exact-qualified indexes shouldn't have stopwords removed >- if ( $index !~ m/phr|ext/ ) { >+ if ( $index !~ m/,(phr|ext)/ ) { > > # remove stopwords from operand : parse all stopwords & remove them (case insensitive) > # we use IsAlpha unicode definition, to deal correctly with diacritics. >@@ -1386,7 +1386,7 @@ sub buildQuery { > > # Set default structure attribute (word list) > my $struct_attr = q{}; >- unless ( $indexes_set || !$index || $index =~ /(st-|phr|ext|wrdl|nb|ns)/ ) { >+ unless ( $indexes_set || !$index || $index =~ /,(st-|phr|ext|wrdl)/ || $index =~ /^(nb|ns)$/ ) { > $struct_attr = ",wrdl"; > } > >@@ -1404,7 +1404,7 @@ sub buildQuery { > } > > if ($auto_truncation){ >- unless ( $index =~ /(st-|phr|ext)/ ) { >+ unless ( $index =~ /,(st-|phr|ext)/ ) { > #FIXME only valid with LTR scripts > $operand=join(" ",map{ > (index($_,"*")>0?"$_":"$_*") >-- >1.7.10.4 >
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 10271
:
18191
|
21297
|
21298
|
22232
|
22233