只需要返回源字段,没有任何元数据-如何使用插件? [英] Need to return source fields only, without any metadata - how to use plugin?
问题描述
我们有一个要求,我们只返回搜索结果中的源字段,而不包含任何元数据。通过搜索,我发现使用Elasticsearch无法做到这一点,但是我确实找到了在该线程中使用插件的参考:
过滤掉元数据字段,并仅在elasticsearch中返回源字段
链接的插件就是这个:
我仍在学习Elasticsearch,但是有人可以解释我将如何在我们的Elasticsearch配置中实现和部署该插件吗?
谢谢,
Jim p>
GET /index/type/_search?filter_path=hits.hits._source
如果要摆脱 hits.hits._source
,可以使用 jq
curl -XGET localhost:9200 / index / type / _search?filter_path = hits.hits._source | jq’.hits.hits [] ._ source’
We have a requirement that we return just the source fields in search results, without any of the metadata. From searching, I gather that this is not possible with elasticsearch, but I did find a reference to maybe using a plugin in this thread:
Filter out metadata fields and only return source fields in elasticsearch
The plugin that was linked was this one:
I'm still learning about elasticsearch, but can someone explain how I would implement and deploy that plugin in our elasticsearch configuration?
Thanks, Jim
As stated in the first link you referenced, it is possible to do it with response filtering which is not a plugin but a standard feature of ES:
GET /index/type/_search?filter_path=hits.hits._source
If you want to get rid of hits.hits._source
you can use jq
curl -XGET localhost:9200/index/type/_search?filter_path=hits.hits._source | jq '.hits.hits[]._source'
这篇关于只需要返回源字段,没有任何元数据-如何使用插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!