Lines 154-160
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
154 |
suggestible => 1, |
154 |
suggestible => 1, |
155 |
sort => 1, |
155 |
sort => 1, |
156 |
marc_type => 'marc21', |
156 |
marc_type => 'marc21', |
157 |
marc_field => '245a', |
157 |
marc_field => '245ab', |
158 |
}, |
158 |
}, |
159 |
{ |
159 |
{ |
160 |
name => 'unimarc_title', |
160 |
name => 'unimarc_title', |
Lines 238-244
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
238 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
238 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
239 |
MARC::Field->new('110', '', '', a => 'Corp Author'), |
239 |
MARC::Field->new('110', '', '', a => 'Corp Author'), |
240 |
MARC::Field->new('210', '', '', a => 'Title 1'), |
240 |
MARC::Field->new('210', '', '', a => 'Title 1'), |
241 |
MARC::Field->new('245', '', '', a => 'Title: first record'), |
241 |
MARC::Field->new('245', '', '', a => 'Title: first record : ', b => 'Subtitle', 'c' => 'Author'), |
|
|
242 |
MARC::Field->new('246', '', '', a => 'Another title : first record : ', b => 'Subtitle'), |
242 |
MARC::Field->new('999', '', '', c => '1234567'), |
243 |
MARC::Field->new('999', '', '', c => '1234567'), |
243 |
# ' ' for testing trimming of white space in boolean value callback: |
244 |
# ' ' for testing trimming of white space in boolean value callback: |
244 |
MARC::Field->new('952', '', '', 0 => ' ', g => '123.30'), |
245 |
MARC::Field->new('952', '', '', 0 => ' ', g => '123.30'), |
Lines 271-277
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
271 |
is_deeply($docs->[0][1]->{author__sort}, ['Author 1 Corp Author'], 'First document author__sort field should be set correctly'); |
272 |
is_deeply($docs->[0][1]->{author__sort}, ['Author 1 Corp Author'], 'First document author__sort field should be set correctly'); |
272 |
|
273 |
|
273 |
is(scalar @{$docs->[0][1]->{title__sort}}, 1, 'First document title__sort field should have one value'); |
274 |
is(scalar @{$docs->[0][1]->{title__sort}}, 1, 'First document title__sort field should have one value'); |
274 |
is_deeply($docs->[0][1]->{title__sort}, ['Title: first record'], 'First document title__sort field should be set correctly'); |
275 |
is_deeply($docs->[0][1]->{title__sort}, ['Title: first record : Subtitle'], 'First document title__sort field should be set correctly'); |
275 |
|
276 |
|
276 |
is(scalar @{$docs->[0][1]->{author__suggestion}}, 2, 'First document author__suggestion field should contain two values'); |
277 |
is(scalar @{$docs->[0][1]->{author__suggestion}}, 2, 'First document author__suggestion field should contain two values'); |
277 |
is_deeply( |
278 |
is_deeply( |
Lines 290-296
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
290 |
is(scalar @{$docs->[0][1]->{title__suggestion}}, 1, 'First document title__suggestion field should contain one value'); |
291 |
is(scalar @{$docs->[0][1]->{title__suggestion}}, 1, 'First document title__suggestion field should contain one value'); |
291 |
is_deeply( |
292 |
is_deeply( |
292 |
$docs->[0][1]->{title__suggestion}, |
293 |
$docs->[0][1]->{title__suggestion}, |
293 |
[{ 'input' => 'Title: first record' }], |
294 |
[{ 'input' => 'Title: first record : Subtitle' }], |
294 |
'First document title__suggestion field should be set correctly' |
295 |
'First document title__suggestion field should be set correctly' |
295 |
); |
296 |
); |
296 |
|
297 |
|
297 |
- |
|
|