Facets filter in elasticsearch defaults to top 10 results

Created on 21 January 2025, 3 months ago

Problem/Motivation

We use a facet filter in a view to filter searchresults from a elasticsearch index. One of these filters has more than 10 options. Because the limit for the facet filter is hard set to 0 in the facets_exposed_filters_views_data_alter hook. Elasticsearch defaults back to the top 10 results.

Steps to reproduce

Implement search api with facets. Create a view with a facet filter. Make sure there are more than 10 options in the filter. The filter on the page will only show the first 10 options.

Proposed resolution

Add an option to the facet filter for the facet limit and implement this in the facets_exposed_filters_search_api_query_alter hook.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024