问题描述
我正在尝试使用pyes进行弹性搜索的简单示例,但是我无法让起始示例正常工作。我正在按照此处的文档进行操作:
I'm trying to get a simple example working with elastic search using pyes, but I'm having trouble getting the starting examples working. I'm following the documentation found here: http://pyes.readthedocs.org/en/latest/manual/usage.html
并且只是尝试运行以下功能,但它不能正常工作。
and just trying to run the following function, but It's not quite working.
def index_transcripts():
conn = ES('127.0.0.1:9200')
conn.indices.create_index("test-index")
index_transcripts()
我认为应该是非常简单,但我得到以下错误:
Which in my mind should be very straightforward, but instead I get the following error:
pyes.exceptions.NoServerAvailable: list index out of range
我刚开始使用弹性搜索,pyes看起来像一个很棒的库,但我很清楚如何我应该使用它。任何帮助将不胜感激。
I'm just starting out with Elastic Search and pyes seems like a wonderful library, but I'm clearly uncertain on how exactly I should use it. Any help would be greatly appreciated.
推荐答案
这将有效:
ES(server=[('http', 'localhost', 9200)])
服务器是一个元组列表。
Server is a list of tuples.
这里的文档是:
这篇关于弹性搜索没有可用的服务器,列表索引超出范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!