仅从Elasticsearch检索_source [英] Retrieve only _source from elasticsearch
本文介绍了仅从Elasticsearch检索_source的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法让我只获取Document&的_source中存在的数据?
Is there a way so that I get only the data present in _source of my Document & not any other metadata like _index,_type,_id,_score while retrieving it from Index?
推荐答案
我从索引中检索索引时没有其他任何元数据,例如_index,_type,_id,_score吗? 。
I got it how to do it.
GET /<index>/<type>/<id>/_source
将仅返回 _source
字段。
示例:
创建具有 ID 123
PUT /website/blog/123
{
"title": "My first blog entry",
"text": "Just trying this out...",
"date": "2014/01/01"
}
到仅检索 _source
字段
GET /website/blog/123/_source
返回:
{
"title": "My first blog entry",
"text": "Just trying this out...",
"date": "2014/01/01"
}
这篇关于仅从Elasticsearch检索_source的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文