Getting IndexnotFound Exception java

I am indexing a document using prepareIndex java API. And it is returning positive status. When I immediately call prepareSearch API it would return IndexNotFound exception. Please help me with this issue.

I tried adding delay of 1 second in between prepareIndex and prepareSearch then it would sometime work and sometime may not work.

Please give me some suggestions.

This question is impossible to answer without a code sample. I suppose you are not waiting for the future of the create index API to return and so the search request sometimes finds an index and sometimes doesnt. But again, just a wild guess without any code.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.