appbaseio / appbaseio/reactivesearch

Allow DataSearch to conditionally skip internal suggestion filtering

Offen
#1,093 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
JavaScript
Sterne
4.9k
Forks
478
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.