You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the number of results exceed a certain limit, has_child query throws a NullPointerException.
curl -x '' -s -XPOST "http://localhost:9200/myindex/vendor/_search?from=0&size=20&pretty=true&routing=0" -d '{
"query" : {
"has_child" : {
"query" : {
"query_string" : { "query" : "signed_date:[now-120d TO now-90d]" }
},
"type" : "transaction"
}
}
}
'
[2013-11-08 15:01:41,825][DEBUG][action.search.type ] [Phage] [myindex_20131108][1], node[fuBzjMWDQgmr_qm0cVLIog], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@23b13dc6]
org.elasticsearch.transport.RemoteTransportException: [Ch'od][inet[/192.168.175.128:9301]][search/phase/query+fetch]
Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: [myindex_20131108][1]: query[filtered(child_filter[transaction/vendor](filtered(signed_date:[1373572895448 TO 1376164895448])->cache(_type:transaction)))->cache(_type:vendor)],from[0],size[20]: Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:123)
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:306)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryFetchTransportHandler.messageReceived(SearchServiceTransportAction.java:686)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryFetchTransportHandler.messageReceived(SearchServiceTransportAction.java:1)
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:270)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
at org.elasticsearch.common.lucene.search.ApplyAcceptedDocsFilter.getDocIdSet(ApplyAcceptedDocsFilter.java:45)
at org.elasticsearch.index.search.child.ChildrenConstantScoreQuery$ParentWeight.scorer(ChildrenConstantScoreQuery.java:178)
at org.apache.lucene.search.FilteredQuery$RandomAccessFilterStrategy.filteredScorer(FilteredQuery.java:533)
at org.apache.lucene.search.FilteredQuery$1.scorer(FilteredQuery.java:133)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:624)
at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:167)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:119)
... 7 more
[2013-11-08 15:01:41,827][DEBUG][action.search.type ] [Phage] All shards failed for phase: [query_fetch]
I debugged the code and found the issue happens due to class ChildrenConstantScoreQuery.java, line #115 is passing null shortCircuitFilter. This happens when remaining value > 8192 so it's not initialized
Filter shortCircuitFilter = null;
if (remaining == 1) {
BytesRef id = collectedUids.v().iterator().next().value.toBytesRef();
shortCircuitFilter = new TermFilter(new Term(UidFieldMapper.NAME, Uid.createUidAsBytes(parentType, id)));
} else if (remaining <= shortCircuitParentDocSet) {
shortCircuitFilter = new ParentIdsFilter(parentType, collectedUids.v().keys, collectedUids.v().allocated);
}
ParentWeight parentWeight = new ParentWeight(parentFilter, shortCircuitFilter, searchContext, collectedUids);
This is bug introduced after 0.90.1 as the query was running fine in past. Thanks!
The text was updated successfully, but these errors were encountered:
If the number of results exceed a certain limit, has_child query throws a NullPointerException.
I debugged the code and found the issue happens due to class ChildrenConstantScoreQuery.java, line #115 is passing null shortCircuitFilter. This happens when remaining value > 8192 so it's not initialized
This is bug introduced after 0.90.1 as the query was running fine in past. Thanks!
The text was updated successfully, but these errors were encountered: