Lines 65-71
subtest "UNIMARC tests" => sub {
Link Here
|
65 |
|
65 |
|
66 |
subtest "_search tests" => sub { |
66 |
subtest "_search tests" => sub { |
67 |
|
67 |
|
68 |
plan tests => 7; |
68 |
plan tests => 8; |
69 |
|
69 |
|
70 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
70 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
71 |
t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch'); |
71 |
t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch'); |
Lines 111-116
subtest "_search tests" => sub {
Link Here
|
111 |
]; |
111 |
]; |
112 |
is_deeply( $terms, $expected_terms, "Search formed as expected with second indicator 7 and subfield 2"); |
112 |
is_deeply( $terms, $expected_terms, "Search formed as expected with second indicator 7 and subfield 2"); |
113 |
|
113 |
|
|
|
114 |
$field = MARC::Field->new( '650', ' ', '4', a => 'Uncles', x => 'Fiction' ); |
115 |
$heading = C4::Heading->new_from_field($field); |
116 |
($search_query) = $heading->_search( 'match-heading' ); |
117 |
$terms = $search_query->{query}->{bool}->{must}; |
118 |
$expected_terms = [ |
119 |
{ term => { 'match-heading.ci_raw' => 'Uncles generalsubdiv Fiction' } }, |
120 |
]; |
121 |
is_deeply( $terms, $expected_terms, "Search doesn't specify thesaurus when heading marked as 'notspecified'"); |
122 |
|
114 |
$field = MARC::Field->new( '100', ' ', '', a => 'Yankovic, Al', d => '1959-,' ); |
123 |
$field = MARC::Field->new( '100', ' ', '', a => 'Yankovic, Al', d => '1959-,' ); |
115 |
$heading = C4::Heading->new_from_field($field); |
124 |
$heading = C4::Heading->new_from_field($field); |
116 |
($search_query) = $heading->_search( 'match-heading' ); |
125 |
($search_query) = $heading->_search( 'match-heading' ); |
117 |
- |
|
|