Bugzilla – Attachment 76884 Details for
Bug 21032
Refining a search made on a specific index fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21032 - fix using facet for searches made on specific index
Bug-21032---fix-using-facet-for-searches-made-on-s.patch (text/plain), 2.62 KB, created by
Séverine Queune
on 2018-07-12 10:40:34 UTC
(
hide
)
Description:
Bug 21032 - fix using facet for searches made on specific index
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-07-12 10:40:34 UTC
Size:
2.62 KB
patch
obsolete
>From 610aa6a3c942d01da492c5f8dd14abc534c2bb25 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Tue, 3 Jul 2018 13:57:00 +0000 >Subject: [PATCH] Bug 21032 - fix using facet for searches made on specific > index >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: > > - Try a simple search (OPAC or staff) like "title:foo", > - click on a facet: badaboum! > - apply this patch, > - retry > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t | 6 ++++-- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 8a0ead1..ebc2786 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -238,7 +238,7 @@ sub build_query_compat { > #die Dumper($query); > # We roughly emulate the CGI parameters of the zebra query builder > my $query_cgi; >- $query_cgi = 'idx=kw&q=' . uri_escape_utf8( $operands->[0] ) if @$operands; >+ $query_cgi = 'q=' . uri_escape_utf8( $operands->[0] ) if @$operands; > my $simple_query; > $simple_query = $operands->[0] if @$operands == 1; > my $query_desc = $simple_query; >diff --git a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >index 5085690..438d345 100644 >--- a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >+++ b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >@@ -81,7 +81,7 @@ subtest 'json2marc' => sub { > }; > > subtest 'build_query tests' => sub { >- plan tests => 23; >+ plan tests => 24; > > t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); > my $query = $builder->build_query(); >@@ -221,12 +221,14 @@ subtest 'build_query tests' => sub { > "query of specific field is added AND suppress:0" > ); > >- ( undef, $query ) = $builder->build_query_compat( undef, ['title:"donald duck"'], undef, undef, undef, undef, undef, { suppress => 0 } ); >+ my ($simple_query, $query_cgi); >+ ( undef, $query, $simple_query, $query_cgi ) = $builder->build_query_compat( undef, ['title:"donald duck"'], undef, undef, undef, undef, undef, { suppress => 0 } ); > is( > $query->{query}{query_string}{query}, > '(title:"donald duck")', > "query of specific field is not added AND suppress:0" > ); >+ is($query_cgi, 'q=title%3A%22donald%20duck%22', 'query cgi'); > }; > > subtest "_convert_sort_fields" => sub { >-- >2.1.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 21032
:
76653
|
76884
|
77332
|
77335