alleyinteractive / alleyinteractive/elasticsearch-extensions

Add support for minimum_should_match to aggregations

Abierto
#51 5 comentarios 0 reacciones 0 asignados Ver en GitHub
elasticsearch enhancement php
Lenguaje dominante
PHP
Estrellas
5
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.