ES 6.x中,如果我们查询的时候不需要返回所有字段,可以添加"_source":[filedid,...]
选择我们需要返回的数据。还可以"_source":{"exclude":[filedid,...]}
来排除一些字段。
举个例子,ES中的数据如果是直接查询返回有好几十个字段,过滤出其中几个字段
POST ip/xxxx/_search
{
"_source": ["email","name","age"],
"query":{
"bool":{
must:[
{
"match":