[英]Elasticsearch. Failed to establish a new connection: [WinError 10061]
After writing this code I get a connection error.编写此代码后,出现连接错误。
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {'author': 'kimchy','text': 'Elasticsearch: cool. bonsai cool.'}
res = es.index(index="test-index", doc_type='tweet', id=1, body=doc)
Is the problem in the code or in my computer?是代码问题还是我的电脑问题? What can I do to fix it?
我能做些什么来修复它?
CURL: localhost:9200 检查您的本地机器上是否正在运行弹性搜索。
I fixed it.我修好了它。 The problem was that the elasticsearch server was not running when I run the code.
问题是当我运行代码时,elasticsearch 服务器没有运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.