Bugzilla – Attachment 24683 Details for
Bug 11533
"use" QueryParser breaks authority search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11533: fix authority searching with no sorting when QueryParser is enabled
Bug-11533-fix-authority-searching-with-no-sorting-.patch (text/plain), 3.53 KB, created by
Kyle M Hall (khall)
on 2014-01-24 13:41:53 UTC
(
hide
)
Description:
Bug 11533: fix authority searching with no sorting when QueryParser is enabled
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-01-24 13:41:53 UTC
Size:
3.53 KB
patch
obsolete
>From 082331ea42df8688b7bae5c759e38a7a3db42db6 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Thu, 16 Jan 2014 20:36:02 +0000 >Subject: [PATCH] Bug 11533: fix authority searching with no sorting when QueryParser is enabled > >This patch fixes an issue where chosing 'None' as the sort order >for an authority search would result in zero hits if QueryParser is >eanbled. > >This patch also adds some additional test cases. > >To test: > >[1] Enable QueryParser. >[2] Perform an authority search in the staff interface that > uses 'Heading A-Z' as the sort order and returns hits. >[3] Run the same search, but with the sort order set to 'None'. > No hits are returned. >[4] Apply the patch. >[5] Do step 3 again. This time, hits should be returned. >[6] Verify that prove -v t/db_dependent/Search.t passes. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/AuthoritiesMarc.pm | 2 +- > t/db_dependent/Search.t | 22 +++++++++++++++++++++- > 2 files changed, 22 insertions(+), 2 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index f7eb122..1c87285 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -221,7 +221,7 @@ sub SearchAuthorities { > $qpquery = $1; > } > >- $qpquery .= " #$sortby"; >+ $qpquery .= " #$sortby" unless $sortby eq ''; > > $QParser->parse( $qpquery ); > $query = $QParser->target_syntax('authorityserver'); >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index d358e98..1233c97 100644 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -12,7 +12,7 @@ use YAML; > use C4::Debug; > require C4::Context; > >-use Test::More tests => 216; >+use Test::More tests => 224; > use Test::MockModule; > use MARC::Record; > use File::Spec; >@@ -737,6 +737,16 @@ sub run_marc21_search_tests { > ); > is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare"'); > ($auths, $count) = SearchAuthorities( >+ ['mainentry'], ['and'], [''], ['starts'], >+ ['shakespeare'], 0, 10, '', 'HeadingAsc', 1 >+ ); >+ is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare" sorted by heading ascending'); >+ ($auths, $count) = SearchAuthorities( >+ ['mainentry'], ['and'], [''], ['starts'], >+ ['shakespeare'], 0, 10, '', 'HeadingDsc', 1 >+ ); >+ is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare" sorted by heading descending'); >+ ($auths, $count) = SearchAuthorities( > ['match'], ['and'], [''], ['contains'], > ['æ²å£«åäºå¨å»å§'], 0, 10, '', '', 1 > ); >@@ -750,6 +760,16 @@ sub run_marc21_search_tests { > ); > is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare" (QP)'); > ($auths, $count) = SearchAuthorities( >+ ['mainentry'], ['and'], [''], ['starts'], >+ ['shakespeare'], 0, 10, '', 'HeadingAsc', 1 >+ ); >+ is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare" sorted by heading ascending (QP)'); >+ ($auths, $count) = SearchAuthorities( >+ ['mainentry'], ['and'], [''], ['starts'], >+ ['shakespeare'], 0, 10, '', 'HeadingDsc', 1 >+ ); >+ is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare" sorted by heading descending (QP)'); >+ ($auths, $count) = SearchAuthorities( > ['match'], ['and'], [''], ['contains'], > ['æ²å£«åäºå¨å»å§'], 0, 10, '', '', 1 > ); >-- >1.7.2.5
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 11533
:
24236
|
24471
|
24472
|
24610
|
24682
| 24683