Bugzilla – Attachment 113903 Details for
Bug 27070
Elasticsearch - with Elasticsearch 6 searches failing unless all terms are in the same field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27070: Add cross_fields type to our searches
Bug-27070-Add-crossfields-type-to-our-searches.patch (text/plain), 1.82 KB, created by
Nick Clemens
on 2020-11-20 19:14:20 UTC
(
hide
)
Description:
Bug 27070: Add cross_fields type to our searches
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2020-11-20 19:14:20 UTC
Size:
1.82 KB
patch
obsolete
>From 2acb67d5a190490df2fd0c8520ac47c69cded9fb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 20 Nov 2020 19:11:10 +0000 >Subject: [PATCH] Bug 27070: Add cross_fields type to our searches > >This patch adds the 'cross_fields' type to our searches: >https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html#query-string-syntax > >Without this patch the search terms seem to all require being in the same field when using Elasticsearch 6 > >To test: >1 - Find a record with a title and publisher >2 - Search for a word form the title and confirm the record is returned >3 - Search for a work from the title and the publisher's name >4 - The record is not returned >5 - Apply patch >6 - Repeat #3 >7 - The record is returned >--- > C4/Circulation.pm | 1 + > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + > 2 files changed, 2 insertions(+) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3fd6ceb55a..2253b5cd5a 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2751,6 +2751,7 @@ sub CanBookBeRenewed { > my $dbh = C4::Context->dbh; > my $renews = 1; > my $auto_renew = "no"; >+ my %reasons; > > my $item = Koha::Items->find($itemnumber) or return ( 0, 'no_item' ); > my $issue = $item->checkout or return ( 0, 'no_checkout' ); >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index a087b19789..e00fc5a523 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -100,6 +100,7 @@ sub build_query { > fields => $fields, > lenient => JSON::true, > analyze_wildcard => JSON::true, >+ type => 'cross_fields', > } > }; > >-- >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 27070
:
113902
|
113903
|
113907
|
113908
|
113911
|
113976