gpt4 book ai didi

python - Elastic Search没有可用的服务器,列表索引超出范围

转载 作者:行者123 更新时间:2023-12-03 00:29:49 24 4
gpt4 key购买 nike

我试图获得一个使用pyes进行 flex 搜索的简单示例,但是我无法使这些初始示例正常工作。我正在关注此处找到的文档:http://pyes.readthedocs.org/en/latest/manual/usage.html

并尝试运行以下功能,但效果不佳。

def index_transcripts():
conn = ES('127.0.0.1:9200')
conn.indices.create_index("test-index")

index_transcripts()

我认为哪一个应该非常简单,但是却收到以下错误:
pyes.exceptions.NoServerAvailable: list index out of range

我只是从Elastic Search开始,而pyes似乎是一个很棒的库,但是我不确定我应该如何使用它。任何帮助将不胜感激。

最佳答案

这将起作用:

ES(server=[('http', 'localhost', 9200)])

服务器是一个元组列表。

文档在这里:
http://pyes.readthedocs.org/en/latest/references/pyes.connection.html

关于python - Elastic Search没有可用的服务器,列表索引超出范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16905295/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com