appbaseio / appbaseio/reactivesearch
Allow DataSearch to conditionally skip internal suggestion filtering
- 主要言語
- JavaScript
- スター
- 4.9k
- フォーク
- 478
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**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.

**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.
コントリビューションガイド
評価
この issue はまだ評価されていません。