我遇到了一个用python进行es查询的问题。我使用的查询是:
response = es_host.search(index=f"<index>,
query={
"aggs": {"0": {"terms": {"field": "parsed_log.requestPath.keyword",
"order": {"_count": "desc"},
"size": 10000}}}, "size": 0,
"script_fields": {},
"stored_fields": ["*"], "runtime_mappings": {},
"query": {"bool": {"must": [],
"filter": [{"match_phrase": {
"parsed_log.responseStatusCode": 200}},
{"range": {"log-time": {
"format": "strict_date_optional_time",
"gte": "2023-07-20T03:30:00.000Z",
"lte": "2023-07-21T03:30:00.000Z"}}}],
"should": [], "must_not": []}}})
字符串
给出以下错误:elasticsearch.BadRequestError:400,'parsing_exception','unknown query [aggs]'错误
有人能让我知道这里发生了什么,也有解决办法吗?
1条答案
按热度按时间o2rvlv0m1#
尝试将查询替换为正文。示例如下:
字符串