appbaseio / appbaseio/reactivesearch

Allow DataSearch to conditionally skip internal suggestion filtering

Abierto
#1,093 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
JavaScript
Estrellas
4.9k
Forks
478
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Is your feature request related to a problem? Please describe.**
I would like to be able to list all of the available options as suggestions with `DataSearch`. Currently the component uses [getSuggestions](https://github.com/appbaseio/reactivecore/blob/master/src/utils/suggestions.js#L23) internally and because of that, all but one of the source documents with an identical value in the targeted field are filtered out.

This can be easily replicated/demonstrated by checking ReactiveSearch Storybook example [with parseSuggestions](https://opensource.appbase.io/playground/?path=/story/search-components-datasearch--with-parsesuggestion): If you enter _Abandon_ to the search field, only one of the two identically named books is listed as a suggestion (see image below). This is not an issue for searching and filtering as in the storybook example but when you want to make a specific selection with `DataSearch` (via `SUGGESTION_SELECT`) it is a deal-breaker.

datasearch

**Describe the solution you'd like**
I would like for `DataSearch` to offer a possibility of returning an unfiltered suggestion-list to the consumer. This could be controlled for instance by a `boolean` flag (`unfilteredSuggestions (default: false)` or similar). This obviously also requires a change to how [**reactivecore**](https://github.com/appbaseio/reactivecore/blob/master/src/utils/suggestions.js#L37) handles the suggestions.

**Describe alternatives you've considered**
As a workaround I am currently including a search-specific unique field to all documents in the index to allow me to list all available options. This has it's own issues of course.

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.