curl -XGET
‘localhost:9200/books/_search?pretty&q=title:elasticsearch’
Responses returned below Elasticsearch
{
"took":4, 请求花了多少时间
"time_out":false, 有没有超时
"_shards":{ 执行请求时查询的分片信息
"total":5, 查询的分片数量
"successful":5, 成功返回结果的分片数量
"failed":0 失败的分片数量
},
"hits":{
"total":2, 查询返回的文档总数
"max_score":0.625, 计算所得的最高分
"hits":[ 返回文档的hits数组
{
"_index":"books", 索引
"_type":"es", 属性
"_id":"1", 标志符
"_score":0.625, 得分
"_source":{ 发送到索引的JSON对象
"title":"Elasticsearch Server",
"publish":2013
}
},
{
"_index":"books",
"_type":"es",
"_id":"2",
"_score":0.19178301,
"_source":{
"title":"Mastering Elasticsearch",
"published":2013
}
}
]
}
}```