获取Elastic 1.7中的所有字段

时间:2016-10-20 14:45:38

标签: elasticsearch

根据documentation of ElasticSearch 1.7

Fields: Allows to selectively load specific stored fields for 
        each document represented by a search hit.

{
    "fields" : ["user", "postDate"],
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}

* can be used to load all stored fields from the document.

因此,我尝试以下方法来检索所有字段:

{
    "fields" : ["*"],
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}

到目前为止没有成功。

1 个答案:

答案 0 :(得分:0)

只需删除字段

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