连接数据库 from elasticsearch import Elasticsearch es = Elasticsearch([{ 'host':"localhost",'port':9200}]) 创建索引 es.indices.create