美文网首页
控制结果中某些字段返回或者不不返回

控制结果中某些字段返回或者不不返回

作者: zz云飞扬 | 来源:发表于2019-12-13 10:21 被阅读0次

1、不显示_source

GET /_search

{

    "_source": false,

    "query" : {

        "term" : { "user" : "kimchy" }

    }

}

2/ 显示正则匹配的字段

GET /_search

{

    "_source": [ "obj1.*", "obj2.*" ],

    "query" : {

        "term" : { "user" : "kimchy" }

    }

}

3/显示和不显示的include 和exclude

GET /_search

{

    "_source": {

        "includes": [ "obj1.*", "obj2.*" ],

        "excludes": [ "*.description" ]

    },

    "query" : {

        "term" : { "user" : "kimchy" }

    }

}

相关文章

网友评论

      本文标题:控制结果中某些字段返回或者不不返回

      本文链接:https://www.haomeiwen.com/subject/wsstnctx.html