/_msearch
方法:GET字段名称 | 描述 |
hits | 返回匹配的查询结果,其中 total 字段表示匹配到的数据条数。里面的 hits 字段为数组结构,若无指定,则包含所有查询结果的前十条。hits 数组里的每个结果中包含 _index(查询涉及到的 子表),若查询中指定了 docvalue_fields,则会返回 fields 字段具体指明每个字段的值。 |
took | 整个查询耗费的毫秒数。 |
_shards | 参与查询的分片数。其中 total 标识总分片数,successful 标识执行成功的数量,failed 标识执行失败的数量,skipped 标识跳过执行的分片数。 |
timed_out | 查询是否超时,取值有 false 和 true。 |
status | 查询返回的状态码,2XX 代表成功。 |
curl -u root:le201909 -H 'Content-Type:application/json' -X GET 172.16.345.14:9201/_msearch -d'{"index" : "amyli_weather","routing":"host_20"}{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}{"index" : "ctsdb_test2017","routing":"host_100"}{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}'
{"responses":[{"took": 0,"timed_out": false,"_shards": {"total": 0,"successful": 0,"skipped": 0,"failed": 0},"hits": {"total": 0,"max_score": 0,"hits": []},"status": 200},{"took": 1,"timed_out": false,"_shards": {"total": 3,"successful": 3,"skipped": 0,"failed": 0},"hits": {"total": 1,"max_score": 1,"hits": [{"_index": "ctsdb_test2017@-979200000_30","_type": "doc","_id": "AV_8fBhlUAkC9PF9L-2t","_score": 1}]},"status": 200}]}
curl -u root:le201909 -H 'Content-Type:application/json' -X GET 172.16.345.14:9201/_msearch?filter_path=responses.\\*\\*.hits,responses._shards.f\\*,-responses.\\*\\*._score -d'{"index" : "amyli_weather","routing":"host_20"}{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}{"index" : "ctsdb_test2017","routing":"host_100"}{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}'
{"responses": [{"_shards": {"failed": 0}},{"_shards": {"failed": 0},"hits": {"hits": [{"_index": "ctsdb_test2017@-979200000_30","_type": "doc","_id": "AV_8fBhlUAkC9PF9L-2t"}]}}]}
本页内容是否解决了您的问题?