1
我無法使用elasticsearch python api在彈性db上執行查詢。我看到以下錯誤。對於彈性對象,我得到Ping爲True。任何人都可以幫我解決這個問題嗎?使用彈性搜索python API執行查詢時發生錯誤
es = Elasticsearch(
['localhost', 'otherhost'],
http_auth=(username,pwd),
port=port_no,
use_ssl=False
)
>>> es.ping
True
>>> es.count(index="events-2017.06.09*")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\elasticsearch\client\utils.py", line 73, i
n _wrapped
return func(*args, params=params, **kwargs)
File "C:\Python27\lib\site-packages\elasticsearch\client\__init__.py", line 11
23, in count
doc_type, '_count'), params=params, body=body)
File "C:\Python27\lib\site-packages\elasticsearch\transport.py", line 312, in
perform_request
status, headers, data = connection.perform_request(method, url, params, body
, ignore=ignore, timeout=timeout)
File "C:\Python27\lib\site-packages\elasticsearch\connection\http_urllib3.py",
line 128, in perform_request
self._raise_error(response.status, raw_data)
File "C:\Python27\lib\site-packages\elasticsearch\connection\base.py", line 12
5, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_me
ssage, additional_info)
elasticsearch.exceptions.NotFoundError: <exception str() failed>
索引事件-2017.06.09是否存在?並嘗試沒有*。 –
是的。該指數存在。而我嘗試沒有*。我犯了同樣的錯誤。 –