Lines 145-151
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
145 |
suggestible => 1, |
145 |
suggestible => 1, |
146 |
sort => 1, |
146 |
sort => 1, |
147 |
marc_type => 'marc21', |
147 |
marc_type => 'marc21', |
148 |
marc_field => '245a', |
148 |
marc_field => '245(ab)ab', |
149 |
}, |
149 |
}, |
150 |
{ |
150 |
{ |
151 |
name => 'unimarc_title', |
151 |
name => 'unimarc_title', |
Lines 228-234
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
228 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
228 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
229 |
MARC::Field->new('110', '', '', a => 'Corp Author'), |
229 |
MARC::Field->new('110', '', '', a => 'Corp Author'), |
230 |
MARC::Field->new('210', '', '', a => 'Title 1'), |
230 |
MARC::Field->new('210', '', '', a => 'Title 1'), |
231 |
MARC::Field->new('245', '', '', a => 'Title: first record'), |
231 |
MARC::Field->new('245', '', '', a => 'Title:', b => 'first record'), |
232 |
MARC::Field->new('999', '', '', c => '1234567'), |
232 |
MARC::Field->new('999', '', '', c => '1234567'), |
233 |
# ' ' for testing trimming of white space in boolean value callback: |
233 |
# ' ' for testing trimming of white space in boolean value callback: |
234 |
MARC::Field->new('952', '', '', 0 => ' ', g => '123.30'), |
234 |
MARC::Field->new('952', '', '', 0 => ' ', g => '123.30'), |
Lines 261-268
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
261 |
is(scalar @{$docs->[0][1]->{author__sort}}, 2, 'First document author__sort field should have two values'); |
261 |
is(scalar @{$docs->[0][1]->{author__sort}}, 2, 'First document author__sort field should have two values'); |
262 |
is_deeply($docs->[0][1]->{author__sort}, ['Author 1', 'Corp Author'], 'First document author__sort field should be set correctly'); |
262 |
is_deeply($docs->[0][1]->{author__sort}, ['Author 1', 'Corp Author'], 'First document author__sort field should be set correctly'); |
263 |
|
263 |
|
264 |
is(scalar @{$docs->[0][1]->{title__sort}}, 1, 'First document title__sort field should have one value'); |
264 |
is(scalar @{$docs->[0][1]->{title__sort}}, 3, 'First document title__sort field should have three values'); |
265 |
is_deeply($docs->[0][1]->{title__sort}, ['Title: first record'], 'First document title__sort field should be set correctly'); |
265 |
is_deeply($docs->[0][1]->{title__sort}, ['Title:', 'first record', 'Title: first record'], 'First document title__sort field should be set correctly'); |
266 |
|
266 |
|
267 |
is(scalar @{$docs->[0][1]->{author__suggestion}}, 2, 'First document author__suggestion field should contain two values'); |
267 |
is(scalar @{$docs->[0][1]->{author__suggestion}}, 2, 'First document author__suggestion field should contain two values'); |
268 |
is_deeply( |
268 |
is_deeply( |
Lines 278-287
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
278 |
'First document author__suggestion field should be set correctly' |
278 |
'First document author__suggestion field should be set correctly' |
279 |
); |
279 |
); |
280 |
|
280 |
|
281 |
is(scalar @{$docs->[0][1]->{title__suggestion}}, 1, 'First document title__suggestion field should contain one value'); |
281 |
is(scalar @{$docs->[0][1]->{title__suggestion}}, 3, 'First document title__suggestion field should contain three values'); |
282 |
is_deeply( |
282 |
is_deeply( |
283 |
$docs->[0][1]->{title__suggestion}, |
283 |
$docs->[0][1]->{title__suggestion}, |
284 |
[{ 'input' => 'Title: first record' }], |
284 |
[ |
|
|
285 |
{ 'input' => 'Title:' }, |
286 |
{ 'input' => 'first record' }, |
287 |
{ 'input' => 'Title: first record' } |
288 |
], |
285 |
'First document title__suggestion field should be set correctly' |
289 |
'First document title__suggestion field should be set correctly' |
286 |
); |
290 |
); |
287 |
|
291 |
|