Return all facets with a number of matches even if number of term matches are zero

Created on 16 June 2022, over 2 years ago
Updated 22 October 2024, 3 months ago

Problem/Motivation

Migrating a site from Solr to OpenSearch for speed and reliability. The searching UI has filtering commonly seen on sites like H*me Dep*t. In Solr, the facets can be configured to only return facet terms that have above a minimum number of matches (min_count parameter >= 0). Between experimenting and looking at the code, this OpenSearch integration does not appear to directly support this.

Proposed resolution

  • Configure search_api_opensearch module so the results are in one call. Preferred but maybe I missed something.
  • Extend search_api_opensearch module so the results are in one call. To be sustainable, this would need to have maintainer support as patches would probably not be maintainable.
  • If real time accuracy is required, execute two queries in rapid succession and facet results can then be mashed together/sorted.
  • If real time accuracy is not important, periodically execute a cron and cache the results which can be then can also be mashed/sorted.

Remaining tasks

Determine best course of action.

Thanks!!!

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kwiechmann

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Christian.wiedemann

    Not sure if this is the right ticket to address this. Right now if the Facet operator is set to "or" a "global": {} is added to the opensearch aggregation which leads to that all facets independent of other filters are returned. The or filter in the facets module is actually used to filter or inside a facet. This is also like solr works. Not sure how to implement that in open search correct. Should I open an own issue for this. Thanks!

Production build 0.71.5 2024