@@ -, +, @@ --- t/Koha/SearchEngine/Elasticsearch.t | 41 +++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) --- a/t/Koha/SearchEngine/Elasticsearch.t +++ a/t/Koha/SearchEngine/Elasticsearch.t @@ -644,17 +644,17 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori my @mappings = ( { - name => 'match-heading', + name => 'match', type => 'string', facet => 0, suggestible => 0, searchable => 1, - sort => undef, + sort => 0, marc_type => 'marc21', - marc_field => '150', + marc_field => '150(ae)', }, { - name => 'match-heading', + name => 'heading', type => 'string', facet => 0, suggestible => 0, @@ -664,7 +664,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori marc_field => '150a', }, { - name => 'match-heading', + name => 'heading', type => 'string', facet => 0, suggestible => 0, @@ -673,6 +673,36 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori marc_type => 'marc21', marc_field => '150(ae)', }, + { + name => 'heading-main', + type => 'string', + facet => 0, + suggestible => 0, + searchable => 1, + sort => 0, + marc_type => 'marc21', + marc_field => '150a', + }, + { + name => 'heading', + type => 'string', + facet => 0, + suggestible => 0, + searchable => 1, + sort => 0, + marc_type => 'marc21', + marc_field => '150', + }, + { + name => 'match-heading', + type => 'string', + facet => 0, + suggestible => 0, + searchable => 1, + sort => 0, + marc_type => 'marc21', + marc_field => '150', + }, ); my $se = Test::MockModule->new('Koha::SearchEngine::Elasticsearch'); @@ -694,7 +724,6 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori }); my $see = Koha::SearchEngine::Elasticsearch::Search->new({ index => $Koha::SearchEngine::Elasticsearch::AUTHORITIES_INDEX }); - my $marc_record_1 = MARC::Record->new(); $marc_record_1->append_fields( MARC::Field->new('001', '123'), --