From ee9345b656f8be2620689c2601e5a16cca3e1fc8 Mon Sep 17 00:00:00 2001 From: Axel Amghar Date: Thu, 16 May 2019 15:33:20 +0200 Subject: [PATCH] Bug 22924: Elasticsearch, show more than 10 facets To test: Without the patch: - check if you have your SysPref SearchEngine with Elasticsearch as value, - put your SysPref FacetMaxCount at 15, - make the search "a" in the catalog, - in Refine your search click on show more for authors, - make sure there is no more than 10 facets dislpaying With the patch: - apply the patch, - make the same, - make sure there is exactly 15 facets for authors. --- Koha/SearchEngine/Elasticsearch/Search.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 4ac8d9d..699498b 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -86,6 +86,13 @@ sub search { my $params = $self->get_elasticsearch_params(); # 20 is the default number of results per page $query->{size} = $count || 20; + + $query->{aggregations}{author}{terms}{size} = $query->{aggregations}{ln}{terms}{size} = + $query->{aggregations}{ccode}{terms}{size} = $query->{aggregations}{'title-series'}{terms}{size} = + $query->{aggregations}{holdingbranch}{terms}{size} = $query->{aggregations}{itype}{terms}{size} = + $query->{aggregations}{subject}{terms}{size} = $query->{aggregations}{'su-geo'}{terms}{size} = + $query->{aggregations}{location}{terms}{size} = 50; + # ES doesn't want pages, it wants a record to start from. if (exists $options{offset}) { $query->{from} = $options{offset}; -- 2.7.4