Browse Source

Bug 25278: Retrieve correct search fields for authorities

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Nick Clemens 1 year ago
committed by Martin Renvoize
parent
commit
3f4ae28cd8
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 6
      Koha/SearchEngine/Elasticsearch.pm
  2. 2
      Koha/SearchEngine/Elasticsearch/QueryBuilder.pm

6
Koha/SearchEngine/Elasticsearch.pm

@ -383,8 +383,10 @@ sub reset_elasticsearch_mappings {
}
my $cache = Koha::Caches->get_instance();
$cache->clear_from_cache('elasticsearch_search_fields_staff_client');
$cache->clear_from_cache('elasticsearch_search_fields_opac');
$cache->clear_from_cache('elasticsearch_search_fields_staff_client_biblios');
$cache->clear_from_cache('elasticsearch_search_fields_opac_biblios');
$cache->clear_from_cache('elasticsearch_search_fields_staff_client_authorities');
$cache->clear_from_cache('elasticsearch_search_fields_opac_authorities');
# FIXME return the mappings?
}

2
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm

@ -1139,7 +1139,7 @@ sub _search_fields {
subfield => undef,
};
my $cache = Koha::Caches->get_instance();
my $cache_key = 'elasticsearch_search_fields' . ($params->{is_opac} ? '_opac' : '_staff_client');
my $cache_key = 'elasticsearch_search_fields' . ($params->{is_opac} ? '_opac' : '_staff_client') . "_" . $self->index;
my $search_fields = $cache->get_from_cache($cache_key, { unsafe => 1 });
if (!$search_fields) {
# The reason we don't use Koha::SearchFields->search here is we don't

Loading…
Cancel
Save