1.安装elasticsearch: download zip 解压
2.启动elasticsearch: 双击 bin目录下的elasticsearch.bat
3.测试elasticsearch是否安装成功:http://localhost:9200/
4:pip install elasticsearch
pip install elasticsearch_dsl
5.test.py
from elasticsearch import Elasticsearch
es=Elasticsearch()
articles={"articleid":"2","title":"title","content":"content"}
es.index(index="articleindex",doc_type="doctype",id=1,body=articles)
es.create(index="articleindex",doc_type="doctype",id=0,body=articles,ignore=409)
# result=es.search(index="articleindex", doc_type="doctype", body=articles)
print("hello")
6.elasticsearch权威指南:https://www.gitbook.com/book/looly/elasticsearch-the-definitive-guide-cn/details
https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html
7.elasticsearch-dsl使用教程:https://elasticsearch-dsl.readthedocs.io/en/latest/