Lines 101-114
$se->mock( 'get_elasticsearch_mappings', sub {
Link Here
|
101 |
return $all_mappings{$self->index}; |
101 |
return $all_mappings{$self->index}; |
102 |
}); |
102 |
}); |
103 |
|
103 |
|
104 |
my $cache = Koha::Caches->get_instance(); |
|
|
105 |
my $clear_search_fields_cache = sub { |
106 |
$cache->clear_from_cache('elasticsearch_search_fields_staff_client_biblios'); |
107 |
$cache->clear_from_cache('elasticsearch_search_fields_opac_biblios'); |
108 |
$cache->clear_from_cache('elasticsearch_search_fields_staff_client_authorities'); |
109 |
$cache->clear_from_cache('elasticsearch_search_fields_opac_authorities'); |
110 |
}; |
111 |
|
112 |
subtest 'build_authorities_query_compat() tests' => sub { |
104 |
subtest 'build_authorities_query_compat() tests' => sub { |
113 |
|
105 |
|
114 |
plan tests => 57; |
106 |
plan tests => 57; |
Lines 635-641
subtest 'build_query with weighted fields tests' => sub {
Link Here
|
635 |
$search_field->update({ weight => 25.0 }); |
627 |
$search_field->update({ weight => 25.0 }); |
636 |
$search_field = Koha::SearchFields->find({ name => 'subject' }); |
628 |
$search_field = Koha::SearchFields->find({ name => 'subject' }); |
637 |
$search_field->update({ weight => 15.5 }); |
629 |
$search_field->update({ weight => 15.5 }); |
638 |
$clear_search_fields_cache->(); |
630 |
Koha::SearchEngine::Elasticsearch->clear_search_fields_cache(); |
639 |
|
631 |
|
640 |
my ( undef, $query ) = $qb->build_query_compat( undef, ['title:"donald duck"'], undef, undef, |
632 |
my ( undef, $query ) = $qb->build_query_compat( undef, ['title:"donald duck"'], undef, undef, |
641 |
undef, undef, undef, { weighted_fields => 1 }); |
633 |
undef, undef, undef, { weighted_fields => 1 }); |