URI Search

可以通过提供请求参数来纯粹使用 URI 来执行搜索请求。 在使用此模式执行搜索时,并非所有搜索选项都会公开,但它可以方便快速的进行“curl 测试”。

这里给出一个例子:

GET twitter/tweet/_search?q=user:kimchy

并给出一个示例响应:

{
    "timed_out": false,
    "took": 62,
    "_shards":{
        "total" : 1,
        "successful" : 1,
        "failed" : 0
    },
    "hits":{
        "total" : 1,
        "max_score": 1.3862944,
        "hits" : [
            {
                "_index" : "twitter",
                "_type" : "tweet",
                "_id" : "0",
                "_score": 1.3862944,
                "_source" : {
                    "user" : "kimchy",
                    "date" : "2009-11-15T14:12:12",
                    "message" : "trying out Elasticsearch",
                    "likes": 0
                }
            }
        ]
    }
}

参数

URI 中允许使用的参数有:

Last updated