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.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.