# NullPointerException using "has\_child" filter after upgrade to v0.90.5

**URL:** <https://discuss.elastic.co/t/nullpointerexception-using-has-child-filter-after-upgrade-to-v0-90-5/14092>\
**Category:** Elasticsearch\
**Created:** [October 24, 2013, 1:09pm UTC](https://discuss.elastic.co/t/nullpointerexception-using-has-child-filter-after-upgrade-to-v0-90-5/14092 "2013-10-24T13:09:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankush\_Jhalani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankush_jhalani/32/875_2.png) [@Ankush\_Jhalani](https://discuss.elastic.co/u/Ankush_Jhalani)\
**Post date:** [October 24, 2013, 1:09pm UTC](https://discuss.elastic.co/t/nullpointerexception-using-has-child-filter-after-upgrade-to-v0-90-5/14092/1 "2013-10-24T13:09:25Z")

</div>

After upgrading from v0.90.1 -\> v0.90.5, we noticed that some of our  
has\_child filter queries started to fail on some shards. Following is the  
request -  
curl -x '' -s -XPOST  
'[http://localhost:9201/data\_index\_20131011/vendor/\_search?from=0&size=2](http://localhost:9201/data_index_20131011/vendor/_search?from=0&size=2)' -d  
'  
{  
"filter" : {  
"has\_child" : {  
"query" : {  
"match" : {  
"set\_aside\_descriptions" : {  
"query" : "No set aside used."  
}  
}  
},  
"type" : "transaction"  
}  
}  
}  
'

And the error trace from logs -  
[2013-10-24 08:54:07,330][TRACE][search] [mach2.node]  
Query phase failed  
org.elasticsearch.search.query.QueryPhaseExecutionException:  
[data\_index\_20131011][0]:  
query[ConstantScore(cache(\_type:vendor))],from[0],size[2]: Query Failed  
[Failed to execute main query]  
at  
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:138)  
at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:219)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:623)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:612)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:269)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)  
at java.lang.Thread.run(Thread.java:722)  
Caused by: java.lang.NullPointerException  
at  
org.elasticsearch.common.lucene.docset.MatchDocIdSet.shortCircuit(MatchDocIdSet.java:82)  
at  
org.elasticsearch.index.search.child.HasChildFilter$ParentDocSet.matchDoc(HasChildFilter.java:174)  
at  
org.elasticsearch.common.lucene.docset.MatchDocIdSet.get(MatchDocIdSet.java:69)  
at  
org.elasticsearch.common.lucene.search.FilteredCollector.collect(FilteredCollector.java:61)  
at org.apache.lucene.search.Scorer.score(Scorer.java:65)  
at  
org.apache.lucene.search.ConstantScoreQuery$ConstantScorer.score(ConstantScoreQuery.java:245)  
at  
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:624)  
at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:162)  
at  
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:488)  
at  
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:444)  
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:134)  
... 7 more

The same query works fine in v0.90.1. It's tough to provide a gist to  
replicate because the error is data dependent, it only happens for some  
queries. For e.g. "query" : "blah blah" works fine but "query" : "No set  
aside used." fails. Also the whole index data size is more than a GB.

This is blocking our upgrade to v0.90.5 so any help would be much  
appreciated. Thanks in advance!!

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [October 24, 2013, 1:40pm UTC](https://discuss.elastic.co/t/nullpointerexception-using-has-child-filter-after-upgrade-to-v0-90-5/14092/2 "2013-10-24T13:40:34Z")

</div>

Hi Ankush

Please open this as an issue. You should never get NPEs.

> **[elastic/elasticsearch](https://github.com/elastic/elasticsearch/issues)**
>
> elasticsearch - Open Source, Distributed, RESTful Search Engine

thanks

clint

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:10am UTC](https://discuss.elastic.co/t/nullpointerexception-using-has-child-filter-after-upgrade-to-v0-90-5/14092/3 "2017-07-06T02:10:47Z")

</div>


