문제

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

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.

도움이 되었습니까?

해결책

This will work:

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

Server is a list of tuples.

Documentation to this is here: http://pyes.readthedocs.org/en/latest/references/pyes.connection.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top