Org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase total failure; shardFailures {[_na_][products][0]: No active shards}{[_na_][products][1]: No active shards}{[_na_][products][2]

Hey everyone,

I indexed some of the documents through java api and they were in this
format:

{"pid":10001,"lang":"lang1","properties":[{"name":"prop1","type":"type1","values":["p1v1","p1v2"]}]}
Indexing works fine for me.

But when I tried to search I got this exception:

Exception in thread "main"
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [dfs], total failure; shardFailures {[na][products][0]: No
active shards}{[na][products][1]: No active shards}{[na][products][2]:
No active shards}{[na][products][3]: No active
shards}{[na][products][4]: No active shards}
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:259)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.start(TransportSearchTypeAction.java:144)
at
org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction.doExecute(TransportSearchDfsQueryThenFetchAction.java:62)
at
org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction.doExecute(TransportSearchDfsQueryThenFetchAction.java:52)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
at
org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:106)
at
org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:43)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:83)
at
org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:206)
at
org.elasticsearch.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:743)
at
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:53)
at
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:47)
at com.ankit.json.IndexJson.search(IndexJson.java:50)
at com.ankit.json.ToJson.main(ToJson.java:72)

Any help would be greatly appreciated..:!!!

Thanks in advance.

Dear ajasuja,

I have the same error as you. Could you tell me whether you find a solution
or not yet?

Best regards,
Rami Sellami.

Hi Rami,

I have a similar problem. I couldn't find a way to fix it but waiting
for 'green status' before querying the created node alleviated the
problem.

this.client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();

-- Thiago

On Fri, Aug 3, 2012 at 6:02 AM, rami sellami sel.rami@gmail.com wrote:

Dear ajasuja,

I have the same error as you. Could you tell me whether you find a solution
or not yet?

Best regards,
Rami Sellami.