diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 577dcda12b..483dada4b3 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -58,6 +58,7 @@ use Search::Elasticsearch::Role::Cxn; } use Try::Tiny qw( catch try ); +use JSON::PP (); use YAML::XS; use List::Util qw( sum0 ); diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t index 5f0564d9fe..0512100b46 100755 --- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t +++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t @@ -28,6 +28,7 @@ use t::lib::TestBuilder; use Test::MockModule; +use JSON::PP (); use MARC::Record; use Try::Tiny; use List::Util qw( any ); @@ -144,7 +145,7 @@ subtest 'get_elasticsearch_settings() tests' => sub { subtest 'get_elasticsearch_mappings() tests' => sub { - plan tests => 3; + plan tests => 5; my $mappings; @@ -206,6 +207,14 @@ subtest 'get_elasticsearch_mappings() tests' => sub { 'Field mappings parsed correctly for sort for callnumber type' ); is( $mappings->{properties}{isbn__sort}{index}, 'false', 'Field mappings parsed correctly' ); + is( + $mappings->{date_detection}, JSON::PP::false, + 'date_detection disabled at mapping root' + ); + is( + $mappings->{numeric_detection}, JSON::PP::false, + 'numeric_detection disabled at mapping root' + ); };