python操作ES的基础都依赖于python的
from elasticsearch import Elasticsearch 包
from elasticsearch import Elasticsearch
import json
import pandas as pd
import re
es = Elasticsearch(hosts="xxxxx", port=xxxx)
if __name__ == '__main__':
query = {'query': {'match': {'spider_time': '2020-08-18'}},"size":1000}
#这里的query就是对es进行查询或者删除的请求体
# result = es.count(index='baidu_person_hotspot') # 查询对应索引下的指定爬取时间的数据总数
# result = es.delete_by_query(index='wy_hot_select',body=query) #按照索引以及对应请求体进行数据删除
#result = es.indices.delete(index='baidu_person_hotspot')#按照索引进行数据删除