appbaseio / appbaseio/reactivecore

Suggestion filtering ignores+removes 'highlight' from ElasticSearch hits

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
33
派生
27
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。