appbaseio / appbaseio/reactivecore
Suggestion filtering ignores+removes 'highlight' from ElasticSearch hits
- Dominant language
- JavaScript
- Stars
- 33
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
ReactiveSearch.DataSearch component provides properties for `customHighlight` and `parseSuggestion` to customise suggestions for current search input. Unfortunately it appears the `highlight` entry of the returned ES hits are being neglected/discarded during the query result processing [here](https://github.com/appbaseio/reactivecore/blob/master/src/utils/suggestions.js#L94). (the `customHighlight` query configuration is properly included in the query sent to ES though!)
Maybe I miss something but it seems to be caused by calling `getSuggestions` of this packages `utils/suggestions.js` module as can be seen in `onSuggestions( query.result )` call here for [WEB Version](https://github.com/appbaseio/reactivesearch/blob/next/packages/web/src/components/search/DataSearch.js#L341) or [Vue.js Version](https://github.com/appbaseio/reactivesearch/blob/next/packages/vue/src/components/search/DataSearch.jsx#L266).
If the above is true, would it be possible to add/maintain `highlight` either as new field in suggestions option dict, e.g. `suggestion.highlight` or as entry in the `suggestion.source` field e.g. `suggestion.source._highlight`?
NOTE: `highlight` may? not be present in hits/query result if `customHighlight` is not configured
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.