How to filter _source in reactivesearch?

喜夏-厌秋 提交于 2019-12-08 06:45:49

问题


I need to exclude certain fields from the _source field in the elastic response since those fields are huge and transferring them unnecessarily wastes lots of time. In general, in elastic this is done by providing _source parameter in the query, e.g.:

GET /_search
{
    "_source": { "excludes": [ "content" ] },
    "query" : { ... }
}

Searchkit, for example, does this exclusion for highlighted fields automatically (which would be ideal in my case), but also supports an option for user to provide _source filter irrespective of highlighting too. Reactivesearch DataSearch component seems to be missing this kind of capability.

I can't figure out how to add _source (or any other search parameter) to the reactivesearch DataSearch query. Is that possible?


回答1:


We currently don't support this behavior in ReactiveSearch, but we should. I have filed an issue for the same https://github.com/appbaseio/reactivesearch/issues/417.

Edit: This is now supported, you can see how to pass it in the documentation of Result components.



来源:https://stackoverflow.com/questions/50880533/how-to-filter-source-in-reactivesearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!