FacetedSearch's facets property has limited amount of buckets
See original GitHub issueI’ve been using the FacetedSearch functionality successfully. All seems to be working well. The facets
property is added to the response returned from the FacetedSearch object. I am able to access a dictionary with lists of buckets (each with appropriate tuple of key, document count and flag).
The problem is that there seems to be a hard limit on the amount of “buckets” (exactly 10 or less). I’m not referring to the results per facet—just the total amount of buckets.
Example Lets assume a search query generates 300 total hits spread over 13 categories for a particular query.
response = blog_search.execute()
total_hit_count = response.hits.total # 300
accumulated_facets_hit_count = 0
category_count = 0
for category, hit_count, is_selected in response.facets.category:
accumulated_facets_hit_count += hit_count
category_count += 1
When checking the results we have the following unexpected results:
# This will give `category_count 10` instead of expected `category_count 13`
print('category_count: ', category_count)
# This will give `False` instead of expected `True`
print(accumulated_facets_hit_count == total_hit_count)
Is there a way to increase the limit of amount of buckets?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Bucket search - facets filter limited to 10 results
Been digging around how to get more than 10 results for each facet filter and can't find any setting to do so -...
Read more >Elasticsearch bucket aggregations and faceted navigation
A step by step tutorial for using Elasticsearch bucket aggregations to implement faceted navigation a.k.a. facets.
Read more >JSON Facet API | Apache Solr Reference Guide 8.1
Faceted search is about aggregating data and calculating metrics about that data. ... Number of buckets beyond the limit to internally request from...
Read more >Faceted Search widget - ServiceNow Docs
The Faceted Search widget displays search results and search facets defined for a search source. The Faceted Search widget enables end users ...
Read more >$facet (aggregation) — MongoDB Manual
Multi-faceted aggregations provide multiple filters and categorizations to guide data browsing and analysis. Retailers commonly use faceting to narrow search ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ops… I forgot an example on how to set the size parameter on any other parameter as well
Hope this helps.
@WisdomPill thank you for your comments. Yeap, according to the docs there exists such a
size
option.For my use-case, all search results are grouped within the resulting buckets (showing the top 5 results per bucket). Currently, if the search query produces greater than 10 buckets, some buckets are left out and the user can not see the results related to those buckets. For example, imagine a search produces results within 20 countries. Where a bucket represents a country, the user will only see 10 counties to facet on instead of 20.
Maybe It would be useful to be able to increase the size parameter for TermsFacet?