From 3b9ed6af5a2acfdf94d89d37bfd5c48bdf37af3f Mon Sep 17 00:00:00 2001 From: Nick Clemens 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 --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + 1 file changed, 1 insertion(+) 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