SearchContextMissingException - No search context found for id

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

SearchContextMissingException - No search context found for id



I am using ES version 1.6.0 and the Python plugin for ES. I have a large collection of documents inside my index and I want to iterate through each and every document inside the index. In this sense I am using scan to get each document and retrieve the sentences it contains. I have written my function using an iterator to yield back each and every sentence. My code is this:

es1 = Elasticsearch(["http://localhost:9200"], timeout=30)

class Sentences(object):

def __init__(self, index, query):

self.index = index

self.query = query

def __iter__(self):

for doc in scan(es1, query=self.query, index=self.index):

doc_sentences = doc["_source"]["doc_sentences"]

for sentence in doc_sentences:

yield sentence

The iterator appers to be running initially, but after a while I get the error: "SearchContextMissingException - No search context found for id" followed by a list of document ids. I tried to increase the ES timeout, but didn't help. What can I do to overcome this? I am running out of ideas.



Please update your bookmarks! We have moved to
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit
For more options, visit