elasticsearch

创建index
es.indices.create(index=index_name, ignore=400, body=mapping)

删除index
es.indices.delete(index_name)
删除数据
delete_by_all = {"query": {"match_all": {}}}
es.delete_by_query(index=index_name, body=delete_by_all)

根据多个字段搜索
delete_by_query = {
    "query":
{"bool": {
"must": [
{"match": {"name": "qw"}},
{"match": {"age": "10"}},]
}
}
}
query = es.search(index=index_name, doc_type="_doc", body=delete_by_query, size=200)
posted @ 2021-07-12 10:26  学渣Mia  阅读(28)  评论(0编辑  收藏  举报