alleyinteractive / alleyinteractive/elasticsearch-extensions

Add support for minimum_should_match to aggregations

Ouverte
#51 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
elasticsearch enhancement php
Langage dominant
PHP
Étoiles
5
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Description

We need a method to be able to include all items in an aggregation, even if no results match those items, as an opt-in feature.

For example, we should have a way of being able to run `elasticsearch_extensions()->get_aggregation_by_query_var( 'taxonomy_custom' )->checkboxes()` and have checkboxes show for all items in the aggregation, even if none of the results match (e.g., show all categories, even if no posts are in a particular category in the results).

### Use Case

A site needs to show an aggregation but listing all the aggregation items available.

### Acceptance Criteria

- Allow an aggregation to be registered with an optional property of the minimum number of items to match in order for the aggregation item to show. This could be set to 0 to show items that don't have any matches (e.g., a category that doesn't have any matches in the results) or a higher number to only show items that have many matches (e.g., 10 to exclude the long tail of matches).

### Comments

This will likely need to be done as a combination of Elasticsearch queries and WordPress database queries, because Elasticsearch won't know about items that are empty (e.g., taxonomy terms that aren't assigned to anything).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.