Bugzilla – Attachment 71618 Details for
Bug 18969
_all field is deprecated - should use copy_to to prepare for ES6
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18969: ES6 - replace use of field include_in_all by copy_to
Bug-18969-ES6---replace-use-of-field-includeinall-.patch (text/plain), 2.87 KB, created by
Alex Arnaud
on 2018-02-14 16:04:42 UTC
(
hide
)
Description:
Bug 18969: ES6 - replace use of field include_in_all by copy_to
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2018-02-14 16:04:42 UTC
Size:
2.87 KB
patch
obsolete
>From f45dc920684caca39731efe5d5a9a072e26a18af Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 14 Feb 2018 16:02:34 +0000 >Subject: [PATCH] Bug 18969: ES6 - replace use of field include_in_all by > copy_to > >Test plan: > > 1) apply this patch, > 2) update your elasticsearch server to the version 6 (6.2?), > 3) reinstall icu plugin, > 4) reindex your authorities and biblios, > 5) check that there is no error in > /var/log/elasticsearch/elasticsearch.log, > 6) try a search on biblios, > 7) check that facet work, > 8) try a search on authorities >--- > Koha/SearchEngine/Elasticsearch.pm | 6 ++++++ > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 5 +++-- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index df7f94c..a5847d5 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -176,8 +176,13 @@ sub get_elasticsearch_mappings { > properties => { > record => { > store => "true", >+ copy_to => "_all_fields", > type => "text", > }, >+ _all_fields => { >+ type => "text", >+ analyzer => "analyser_standard" >+ }, > } > } > }; >@@ -224,6 +229,7 @@ sub get_elasticsearch_mappings { > search_analyzer => "analyser_phrase", > analyzer => "analyser_phrase", > type => "text", >+ copy_to => "_all_fields", > fields => { > phrase => { > type => "keyword", >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index f131542..04550a2 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -90,6 +90,7 @@ sub build_query { > query => $query, > fuzziness => $fuzzy_enabled ? 'auto' : '0', > default_operator => 'AND', >+ default_field => '_all_fields', > lenient => JSON::true, > } > }; >@@ -292,7 +293,7 @@ sub build_authorities_query { > my @filter_parts; > foreach my $s ( @{ $search->{searches} } ) { > my ( $wh, $op, $val ) = @{$s}{qw(where operator value)}; >- $wh = '_all' if $wh eq ''; >+ $wh = '_all_fields' if $wh eq ''; > if ( $op eq 'is' || $op eq '=' ) { > > # look for something that matches completely >@@ -512,7 +513,7 @@ types. > =cut > > our %index_field_convert = ( >- 'kw' => '', >+ 'kw' => '_all_fields', > 'ti' => 'title', > 'au' => 'author', > 'su' => 'subject', >-- >2.7.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 18969
:
71607
|
71618
|
71619
|
72654
|
73498
|
87143