Failed to execute phase [query], total failure; shardFailures


(xenoon) #1

I get an error follow as:

Exception in thread "main" org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], total failure; shardFailures {[na][test_index][0]: No active shards}{[na][test_index][1]: No active shards}{[na][test_index][2]: No active shards}{[na][test_index][3]: No active shards}{[na][test_index][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.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:58)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:48)
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:108)
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.elastic.SearchTest.main(SearchTest.java:24)

my test code :
Client client = ElasticSearchUtils.getClientInstance();
QueryBuilder qb1 = new TermQueryBuilder("title", "this");
SearchResponse response = client.prepareSearch().setQuery(qb1).execute().actionGet();
SearchHits hits = response.getHits();
if(hits!=null){
for(SearchHit hit :hits){
System.out.println(hit.getSource().get("description"));
}
}


(system) #2