From cbfeaca85998f77686a4c6860e21d1e7e02c9770 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 3 Mar 2019 21:36:22 -0300 Subject: [PATCH] Bug 18235: Do not call get_facetable_fields excessively Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens --- admin/searchengine/elasticsearch/mappings.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl index de891ac9ea..f91399aa9d 100755 --- a/admin/searchengine/elasticsearch/mappings.pl +++ b/admin/searchengine/elasticsearch/mappings.pl @@ -176,6 +176,7 @@ for my $index_name (@index_names) { } } +my @facetable_fields = Koha::SearchEngine::Elasticsearch->get_facetable_fields(); for my $index_name (@index_names) { my $search_fields = Koha::SearchFields->search( { 'search_marc_map.index_name' => $index_name, 'search_marc_map.marc_type' => $marc_type, }, @@ -187,7 +188,6 @@ for my $index_name (@index_names) { ); my @mappings; - my @facetable_fields = Koha::SearchEngine::Elasticsearch->get_facetable_fields(); my @facetable_field_names = map { $_->name } @facetable_fields; while ( my $s = $search_fields->next ) { @@ -215,7 +215,6 @@ while ( my $search_field = $search_fields->next ) { push @all_search_fields, $search_field_unblessed; } -my @facetable_fields = Koha::SearchEngine::Elasticsearch->get_facetable_fields(); $template->param( indexes => \@indexes, all_search_fields => \@all_search_fields, -- 2.39.5