Bugzilla – Attachment 93624 Details for
Bug 20589
Add field boosting and use elastic query fields parameter instead of deprecated _all
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20589: (follow-up) Fix tests
Bug-20589-follow-up-Fix-tests.patch (text/plain), 7.91 KB, created by
Nick Clemens (kidclamp)
on 2019-10-03 14:42:43 UTC
(
hide
)
Description:
Bug 20589: (follow-up) Fix tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-10-03 14:42:43 UTC
Size:
7.91 KB
patch
obsolete
>From d2bf9c4b2f540ed7d76170b4f5bdb75283b0ebde Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Thu, 3 Oct 2019 14:42:25 +0000 >Subject: [PATCH] Bug 20589: (follow-up) Fix tests > >--- > Koha/SearchEngine/Elasticsearch.pm | 1 - > t/Koha/SearchEngine/Elasticsearch.t | 22 +++++++++++++++++++--- > 2 files changed, 19 insertions(+), 4 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 75bf582b7d..ae0b7fdf48 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -890,7 +890,6 @@ sub _get_marc_mapping_rules { > > my $range = defined $3 ? $3 : undef; > my @mappings = $self->_field_mappings($facet, $suggestible, $sort, $search, $name, $type, $range); >- > if ($field_tag < 10) { > $rules->{control_fields}->{$field_tag} //= []; > push @{$rules->{control_fields}->{$field_tag}}, @mappings; >diff --git a/t/Koha/SearchEngine/Elasticsearch.t b/t/Koha/SearchEngine/Elasticsearch.t >index 5b688ab41e..673babb131 100644 >--- a/t/Koha/SearchEngine/Elasticsearch.t >+++ b/t/Koha/SearchEngine/Elasticsearch.t >@@ -100,7 +100,7 @@ subtest 'get_elasticsearch_settings() tests' => sub { > # test reading index settings > my $es = Koha::SearchEngine::Elasticsearch->new( {index => $Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX} ); > $settings = $es->get_elasticsearch_settings(); >- is( $settings->{index}{analysis}{analyzer}{analyser_phrase}{tokenizer}, 'keyword', 'Index settings parsed correctly' ); >+ is( $settings->{index}{analysis}{analyzer}{analyzer_phrase}{tokenizer}, 'keyword', 'Index settings parsed correctly' ); > }; > > subtest 'get_elasticsearch_mappings() tests' => sub { >@@ -112,7 +112,7 @@ subtest 'get_elasticsearch_mappings() tests' => sub { > # test reading mappings > my $es = Koha::SearchEngine::Elasticsearch->new( {index => $Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX} ); > $mappings = $es->get_elasticsearch_mappings(); >- is( $mappings->{data}{_all}{type}, 'string', 'Field mappings parsed correctly' ); >+ is( $mappings->{data}{properties}{isbn__sort}{index}, 'false', 'Field mappings parsed correctly' ); > }; > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { >@@ -128,6 +128,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => undef, > marc_type => 'marc21', > marc_field => '001', >@@ -137,6 +138,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'isbn', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => '020a', >@@ -146,6 +148,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 1, > suggestible => 1, >+ searchable => 1, > sort => undef, > marc_type => 'marc21', > marc_field => '100a', >@@ -155,6 +158,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 1, > suggestible => 1, >+ searchable => 1, > sort => 1, > marc_type => 'marc21', > marc_field => '110a', >@@ -164,6 +168,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 1, >+ searchable => 1, > sort => 1, > marc_type => 'marc21', > marc_field => '245(ab)ab', >@@ -173,6 +178,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 1, >+ searchable => 1, > sort => 1, > marc_type => 'unimarc', > marc_field => '245a', >@@ -182,6 +188,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => undef, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => '220', >@@ -191,6 +198,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => undef, > marc_type => 'marc21', > marc_field => '245', >@@ -200,6 +208,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'sum', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => '952g', >@@ -209,6 +218,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'boolean', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => '9520', >@@ -218,6 +228,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 1, > marc_type => 'marc21', > marc_field => '952o', >@@ -227,6 +238,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => 'leader_/6', >@@ -236,6 +248,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => 'leader_/6-7', >@@ -245,6 +258,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > type => 'string', > facet => 0, > suggestible => 0, >+ searchable => 1, > sort => 0, > marc_type => 'marc21', > marc_field => '007_/0', >@@ -262,6 +276,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > $map->{facet}, > $map->{suggestible}, > $map->{sort}, >+ $map->{searchable}, > $map->{marc_type}, > $map->{marc_field} > ); >@@ -307,7 +322,6 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > > # First record: > is(scalar @{$docs}, 2, 'Two records converted to documents'); >- > is($docs->[0][0], '1234567', 'First document biblionumber should be set as first element in document touple'); > > is_deeply($docs->[0][1]->{control_number}, ['123'], 'First record control number should be set correctly'); >@@ -519,6 +533,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () t > facet => 0, > suggestible => 0, > sort => undef, >+ searchable => 1, > marc_type => 'marc21', > marc_field => '001', > } >@@ -535,6 +550,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () t > $map->{facet}, > $map->{suggestible}, > $map->{sort}, >+ $map->{searchable}, > $map->{marc_type}, > $map->{marc_field} > ); >-- >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 20589
:
74245
|
74249
|
74301
|
74373
|
74418
|
74419
|
82503
|
82544
|
83016
|
83019
|
87358
|
87411
|
87412
|
87415
|
87416
|
92454
|
92455
|
92456
|
92457
|
93238
|
93239
|
93240
|
93241
|
93247
|
93248
|
93249
|
93250
|
93251
|
93348
|
93349
|
93350
|
93351
|
93352
|
93353
|
93379
|
93380
|
93381
|
93382
|
93383
|
93384
|
93590
| 93624