Lines 752-758
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () t
Link Here
|
752 |
|
752 |
|
753 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authority tests' => sub { |
753 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authority tests' => sub { |
754 |
|
754 |
|
755 |
plan tests => 3; |
755 |
plan tests => 5; |
756 |
|
756 |
|
757 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
757 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
758 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
758 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
Lines 773-778
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori
Link Here
|
773 |
sort => 0, |
773 |
sort => 0, |
774 |
marc_type => 'marc21', |
774 |
marc_type => 'marc21', |
775 |
marc_field => '150(aevxyz)', |
775 |
marc_field => '150(aevxyz)', |
|
|
776 |
}, |
777 |
{ |
778 |
name => 'match', |
779 |
type => 'string', |
780 |
facet => 0, |
781 |
suggestible => 0, |
782 |
searchable => 1, |
783 |
sort => 0, |
784 |
marc_type => 'marc21', |
785 |
marc_field => '185v', |
776 |
} |
786 |
} |
777 |
); |
787 |
); |
778 |
|
788 |
|
Lines 806-812
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori
Link Here
|
806 |
$marc_record_2->append_fields( |
816 |
$marc_record_2->append_fields( |
807 |
MARC::Field->new('150', '', '', a => 'Subject', v => 'Genresubdiv', z => 'Geosubdiv', x => 'Generalsubdiv', e => 'wrongsubdiv' ), |
817 |
MARC::Field->new('150', '', '', a => 'Subject', v => 'Genresubdiv', z => 'Geosubdiv', x => 'Generalsubdiv', e => 'wrongsubdiv' ), |
808 |
); |
818 |
); |
809 |
my $records = [ $marc_record_1, $marc_record_2 ]; |
819 |
my $marc_record_3 = MARC::Record->new(); |
|
|
820 |
$marc_record_3->append_fields( |
821 |
MARC::Field->new('185', '', '', v => 'Formsubdiv' ), |
822 |
); |
823 |
my $records = [ $marc_record_1, $marc_record_2, $marc_record_3 ]; |
810 |
|
824 |
|
811 |
$see->get_elasticsearch_mappings(); #sort_fields will call this and use the actual db values unless we call it first |
825 |
$see->get_elasticsearch_mappings(); #sort_fields will call this and use the actual db values unless we call it first |
812 |
|
826 |
|
Lines 827-832
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori
Link Here
|
827 |
$docs->[1]->{'match'} , |
841 |
$docs->[1]->{'match'} , |
828 |
"Second record heading should contain the subfields with record order retained" |
842 |
"Second record heading should contain the subfields with record order retained" |
829 |
); |
843 |
); |
|
|
844 |
ok( !exists $docs->[2]->{'match-heading'}, "No match heading defined for subdivision record"); |
845 |
is_deeply( |
846 |
[ "Formsubdiv" ], |
847 |
$docs->[2]->{'match'} , |
848 |
"Third record heading should contain the subfield" |
849 |
); |
850 |
|
830 |
}; |
851 |
}; |
831 |
|
852 |
|
832 |
$schema->storage->txn_rollback; |
853 |
$schema->storage->txn_rollback; |
833 |
- |
|
|