[英]Elasticsearch Python API
我正在嘗試使用Python API“ pyes”來處理elasticsearch,但是我第一次無法啟動它,我正在運行以下代碼:
import pyes
conn = pyes.ES('127.0.0.1:9200')
conn.indices.create_index("test-index")
並得到以下錯誤:
No handlers could be found for logger "pyes"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/easd/data01/binmaham/python/lib/python2.7/site-packages/pyes-0.99.2-py2.7.egg/pyes/managers.py", line 155, in create_index
return self.conn._send_request('PUT', index, settings)
File "/easd/data01/binmaham/python/lib/python2.7/site-packages/pyes-0.99.2-py2.7.egg/pyes/es.py", line 441, in _send_request
response = self.connection.execute(request)
File "/easd/data01/binmaham/python/lib/python2.7/site-packages/pyes-0.99.2-py2.7.egg/pyes/connection_http.py", line 109, in execute
self._local.server = server = self._get_server()
File "/easd/data01/binmaham/python/lib/python2.7/site-packages/pyes-0.99.2-py2.7.egg/pyes/connection_http.py", line 145, in _get_server
raise NoServerAvailable(ex)
pyes.exceptions.NoServerAvailable: list index out of range
如@furas和您的錯誤消息所建議,要啟動您的ElasticSearch服務器,請運行sudo /etc/init.d/elasticsearch start
,您可以在此處閱讀
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.