# 创建 Elasticsearch 客户端连接
client = Elasticsearch(hosts=['localhost']) # 根据实际情况修改主机地址
# 定义查询请求体
query_body = {
"query": {
"bool": {
"must": [
{"match": {"field1": "value1"}},
{"match": {"field2": "value2"}},
{"match": {"field3": "value3"}}
]
}
}
}
# 发送查询请求
response = client.search(index='your_index_name', body=query_body) # 根据实际情况修改索引名称
# 处理查询结果
for hit in response['hits']['hits']:
print(hit['_source'])
05-23
7728
09-21
590
06-14
3979
05-31
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交