Getting [docsnew] IndexNotFoundException[no such index]

Running the command http://localhost:9200/_cat/indices lists out the index docsnew from the elasticsearch database. Also, able the entries are listed when i enter the following in the browser
http://localhost:9200/docsnew/doc/518d3dbc4e535f44c15649960b322d7

But, when i execute the query from java,
QueryBuilder qb = QueryBuilders.matchQuery("content", value);
SearchResponse response = client.prepareSearch(index) //
.setQuery(qb) // Query
.execute().actionGet();
Throws [docsnew] IndexNotFoundException[no such index] Exception. Any Insights will be helpful.

May be you are connected to another cluster than the one you think is running at localhost:9200 ?

Figured out the issue, I was using an older version of elastic search in dependency POM. Got it fixed and able to retrieve now. Thanks for looking into the post.

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