appbaseio / appbaseio/reactivecore

Suggestion filtering ignores+removes 'highlight' from ElasticSearch hits

Aperta
#52 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
33
Fork
27
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.