Bugzilla – Attachment 73498 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), 4.04 KB, created by
Bouzid Fergani
on 2018-03-30 19:45:47 UTC
(
hide
)
Description:
Bug 18969: ES6 - replace use of field include_in_all by copy_to
Filename:
MIME Type:
Creator:
Bouzid Fergani
Created:
2018-03-30 19:45:47 UTC
Size:
4.04 KB
patch
obsolete
>From 83b1f1cad78de2552e8629ac1066798d66ebd088 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 14 Feb 2018 13:55:57 +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 > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> >--- > Koha/SearchEngine/Elasticsearch.pm | 15 ++++++++++----- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 6 +++--- > 2 files changed, 13 insertions(+), 8 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index d859a39..a5847d5 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -173,13 +173,16 @@ sub get_elasticsearch_mappings { > # TODO cache in the object? > my $mappings = { > data => { >- _all => {type => "string", analyzer => "analyser_standard"}, > properties => { > record => { > store => "true", >- include_in_all => JSON::false, >+ copy_to => "_all_fields", > type => "text", > }, >+ _all_fields => { >+ type => "text", >+ analyzer => "analyser_standard" >+ }, > } > } > }; >@@ -226,7 +229,7 @@ sub get_elasticsearch_mappings { > search_analyzer => "analyser_phrase", > analyzer => "analyser_phrase", > type => "text", >- include_in_all => JSON::false, >+ copy_to => "_all_fields", > fields => { > phrase => { > type => "keyword", >@@ -254,7 +257,7 @@ sub _elasticsearch_mapping_for_boolean { > > return { > type => $type, >- null_value => 0, >+ null_value => 'false', > }; > } > >@@ -344,7 +347,9 @@ sub get_fixer_rules { > # boolean gets special handling, basically if it doesn't exist, > # it's added and set to false. Otherwise we can't query it. > push @rules, >- "unless exists('$name') add_field('$name', 0) end"; >+ "unless exists('$name') add_field('$name', 'false') end"; >+ push @rules, >+ "if exists('$name') add_field('$name', 'true') end"; > } > if ($type eq 'sum' ) { > push @rules, "sum('$name')"; >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 8a0ead1..b330e28 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -90,7 +90,7 @@ sub build_query { > query => $query, > fuzziness => $fuzzy_enabled ? 'auto' : '0', > default_operator => 'AND', >- default_field => '_all', >+ default_field => '_all_fields', > lenient => JSON::true, > } > }; >@@ -293,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 >@@ -514,7 +514,7 @@ types. > =cut > > our %index_field_convert = ( >- 'kw' => '_all', >+ '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