语句示例

//请求地址
post
http://eshost:9200/esindex-20220502/_search?

//查询条件:
{
	"query": {
		"bool": {
			"must": [{
				"term": {
					"trace_type.keyword": "xxxxxx"
				}
			}, {
				"term": {
					"product_type.keyword": "aaaaa"
				}
			}],
			"must_not": [],
			"should": []
		}
	},
	"from": 0,
	"size": 0,
	"sort": [],
    "track_total_hits":true,//开启精确查询,没有此字段,total最大10000条
	"aggs": {}
}
//响应结果:
{
    "took": 7,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 51297,
            "relation": "eq"
        },
        "max_score": null,
        "hits": []
    }
}


Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐