Hi,
After version upgrading to 0.90.10, I am facing a issue in
SearchScrollRequestBuilder when query having parent filters, the response
having the following failure message:
{
"took" : 45,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 0,
"failed" : 1,
"failures" : [ {
"index" : "12345",
"shard" : 1,
"status" : 500,
"reason" :
"RemoteTransportException[[Americop][inet[/10.0.0.5:9300]][search/phase/scan/scroll]];
nested: QueryPhaseExecutionException[[12345][1]:
query[ConstantScore(cache(_type:CTable))],from[0],size[10000]: Query Failed
[Failed to execute main query]]; nested: NullPointerException; "
} ]
},
"hits" : {
"total" : 1,
"max_score" : 0.0,
"hits" : [ ]
}
}
the same request working successfully via SearchRequestBuilder or REST.
Am I missing something as it was running fine in version 0.90.5 ?
To reproduce the same :
curl -XPOST 'http://localhost:9200/12345'
curl -XPUT 'http://localhost:9200/12345/PTable/row1?routing=12345' -d '{
"user" : "dev-elasticsearch",
"post_date" : "2014-01-12",
"message" : "search with hasParentFilter in scroll not working"
}'
Run the following code :
public static void main(String[] args) {
Client client = NodeBuilder.nodeBuilder().node().client();
/*
PutMappingRequestBuilder pmrb = client.admin().indices()
.preparePutMapping("12345").setType("CTable");
pmrb.setSource("{"CTable":{"_parent":{"type":"PTable"},"_routing":{"required":true}}}");
pmrb.execute().actionGet();
IndexRequestBuilder irb = new IndexRequestBuilder(client);
irb.setIndex("12345");
irb.setType("CTable");
irb.setId("childRow1");
irb.setRouting("12345");
irb.setParent("row1");
Map<String, Object> data = new HashMap<String, Object>();
data.put("col1", "val1");
irb.setSource(data);
irb.execute().actionGet();*/
SearchRequestBuilder searchRequestBuilder = new
SearchRequestBuilder(
client);
searchRequestBuilder.setIndices("12345");
searchRequestBuilder.setTypes("CTable");
searchRequestBuilder.setRouting("12345");
FilterBuilder postFilter = FilterBuilders.hasParentFilter("PTable",
FilterBuilders.termFilter("user", "elasticsearch"));
searchRequestBuilder.setPostFilter(postFilter);
searchRequestBuilder.addField("col1");
searchRequestBuilder.setScroll("5m");
searchRequestBuilder.setSearchType(SearchType.SCAN);
searchRequestBuilder.setSize(10000);
SearchResponse sr = searchRequestBuilder.execute().actionGet();
String scrollId = sr.getScrollId();
SearchScrollRequestBuilder searchScrollRequestBuilder = new
SearchScrollRequestBuilder(
client);
searchScrollRequestBuilder.setScrollId(scrollId);
SearchResponse searchScrollResponse = searchScrollRequestBuilder
.execute().actionGet();
ClearScrollRequestBuilder clearScrollRequestBuilder = new
ClearScrollRequestBuilder(
client);
clearScrollRequestBuilder.addScrollId(scrollId);
boolean isCleared = clearScrollRequestBuilder.execute().actionGet()
.isSucceeded();
System.out.println(searchScrollResponse.getShardFailures());
}
Thanks
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1652d726-6e9e-4e91-a222-a06128182a8a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.