Bugzilla – Attachment 94792 Details for
Bug 22874
Limit to available items doesn't work with elasticsearch 6.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22874: Use false instaed of 0 value for limiting on availability
Bug-22874-Use-false-instaed-of-0-value-for-limitin.patch (text/plain), 2.39 KB, created by
Nick Clemens (kidclamp)
on 2019-10-25 16:19:51 UTC
(
hide
)
Description:
Bug 22874: Use false instaed of 0 value for limiting on availability
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-10-25 16:19:51 UTC
Size:
2.39 KB
patch
obsolete
>From 3f4c80ad4c827a7b5b2db515e23d50c9930359dd Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Thu, 9 May 2019 12:39:51 +0000 >Subject: [PATCH] Bug 22874: Use false instaed of 0 value for limiting on > availability >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan > > - Set up a elasticsearch 6 instance to work with Koha, > - you may need to make koha works with ES 6 (see bug 20589), > - make a search and limit it to available items only, > => no result > > - Apply this patch, > - make a search and limit it to available items only, > - you should get some results > > - Do the same with ES 5.x > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 3e63086730..b418739cdf 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -965,7 +965,7 @@ sub _fix_limit_special_cases { > push @new_lim, "copydate:$date"; > } > elsif ( $l =~ /^available$/ ) { >- push @new_lim, 'onloan:0'; >+ push @new_lim, 'onloan:false'; > } > else { > push @new_lim, $l; >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index fd983498aa..0f8ed2e9a4 100644 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -346,10 +346,10 @@ subtest 'build_query tests' => sub { > "query of just '*' is unaltered when QueryAutoTruncate is enabled" > ); > >- ( undef, $query ) = $qb->build_query_compat( undef, ['"donald duck"'] ); >+ ( undef, $query ) = $qb->build_query_compat( undef, ['"donald duck"'], undef, ['available'] ); > is( > $query->{query}{query_string}{query}, >- '("donald duck")', >+ '("donald duck") AND onloan:false', > "query with quotes is unaltered when QueryAutoTruncate is enabled" > ); > >-- >2.11.0
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 22874
:
89506
|
93359
| 94792