Lines 186-192
subtest 'get_elasticsearch_mappings() tests' => sub {
Link Here
|
186 |
|
186 |
|
187 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
187 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
188 |
|
188 |
|
189 |
plan tests => 66; |
189 |
plan tests => 67; |
190 |
|
190 |
|
191 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
191 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
192 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
192 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
Lines 293-298
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
293 |
marc_type => 'marc21', |
293 |
marc_type => 'marc21', |
294 |
marc_field => '245', |
294 |
marc_field => '245', |
295 |
}, |
295 |
}, |
|
|
296 |
{ |
297 |
name => 'title_sort', |
298 |
type => 'string', |
299 |
facet => 0, |
300 |
suggestible => 0, |
301 |
searchable => 0, |
302 |
sort => 1, |
303 |
marc_type => 'marc21', |
304 |
marc_field => '246a', |
305 |
}, |
296 |
{ |
306 |
{ |
297 |
name => 'sum_item_price', |
307 |
name => 'sum_item_price', |
298 |
type => 'sum', |
308 |
type => 'sum', |
Lines 436-441
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
436 |
MARC::Field->new('650', '', '', a => 'Heading', z => 'Geohead', v => 'Formhead'), |
446 |
MARC::Field->new('650', '', '', a => 'Heading', z => 'Geohead', v => 'Formhead'), |
437 |
MARC::Field->new('650', '', '', a => 'Heading', x => 'Gensubhead', z => 'Geohead'), |
447 |
MARC::Field->new('650', '', '', a => 'Heading', x => 'Gensubhead', z => 'Geohead'), |
438 |
MARC::Field->new('999', '', '', c => '1234567'), |
448 |
MARC::Field->new('999', '', '', c => '1234567'), |
|
|
449 |
MARC::Field->new('246', '', '', a => '#$[Title!'), |
439 |
# ' ' for testing trimming of white space in boolean value callback: |
450 |
# ' ' for testing trimming of white space in boolean value callback: |
440 |
MARC::Field->new('952', '', '', 0 => ' ', g => '123.30', o => $callno, l => 3), |
451 |
MARC::Field->new('952', '', '', 0 => ' ', g => '123.30', o => $callno, l => 3), |
441 |
MARC::Field->new('952', '', '', 0 => 0, g => '127.20', o => $callno2, l => 2), |
452 |
MARC::Field->new('952', '', '', 0 => 0, g => '127.20', o => $callno2, l => 2), |
Lines 619-624
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
619 |
'First document copydate field should be set correctly' |
630 |
'First document copydate field should be set correctly' |
620 |
); |
631 |
); |
621 |
|
632 |
|
|
|
633 |
is( |
634 |
$docs->[0]->{title_sort__sort}[0], |
635 |
'Title!', |
636 |
'First document title_sort should have initial non word characters stripped', |
637 |
); |
638 |
|
622 |
# Second record: |
639 |
# Second record: |
623 |
|
640 |
|
624 |
is(scalar @{$docs->[1]->{author}}, 1, 'Second document author field should contain one value'); |
641 |
is(scalar @{$docs->[1]->{author}}, 1, 'Second document author field should contain one value'); |
625 |
- |
|
|