# AssertionError at TopScoreDocCollector$InOrderTopScoreDocCollector.collect

**URL:** <https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429>\
**Category:** Elasticsearch\
**Created:** [May 18, 2011, 9:51am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429 "2011-05-18T09:51:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [May 18, 2011, 9:51am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429/1 "2011-05-18T09:51:05Z")

</div>

I'm getting in one of my test cases the following error when searching  
but maybe it is again already fixed 🙂

Exception in thread "elasticsearch[search]-pool-3-thread-2"  
java.lang.AssertionError  
at org.apache.lucene.search.TopScoreDocCollector  
$InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:50)  
at org.apache.lucene.search.Scorer.score(Scorer.java:90)  
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
519)  
at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:  
174)  
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
384)  
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
291)  
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
279)  
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:  
211)  
at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:  
222)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:  
134)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction  
$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:  
76)  
at org.elasticsearch.action.search.type.TransportSearchTypeAction  
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)  
at org.elasticsearch.action.search.type.TransportSearchTypeAction  
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:75)  
at org.elasticsearch.action.search.type.TransportSearchTypeAction  
$BaseAsyncAction$2.run(TransportSearchTypeAction.java:169)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.runTask(ThreadPoolExecutor.java:886)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 18, 2011, 9:53am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429/2 "2011-05-18T09:53:39Z")

</div>

Can you provide a recreation? Its an internal assertion in Lucene.  
On Wednesday, May 18, 2011 at 12:51 PM, Karussell wrote:

> I'm getting in one of my test cases the following error when searching  
> but maybe it is again already fixed 🙂
> 
> Exception in thread "elasticsearch[search]-pool-3-thread-2"  
> java.lang.AssertionError  
> at org.apache.lucene.search.TopScoreDocCollector  
> $InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:50)  
> at org.apache.lucene.search.Scorer.score(Scorer.java:90)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 519)  
> at  
> org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:  
> 174)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 384)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 291)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 279)  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:  
> 211)  
> at  
> org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:  
> 222)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:  
> 134)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction  
> $AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:  
> 76)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> $BaseAsyncAction.access$000(TransportSearchTypeAction.java:75)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> $BaseAsyncAction$2.run(TransportSearchTypeAction.java:169)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [May 18, 2011, 9:54am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429/3 "2011-05-18T09:54:04Z")

</div>

ah, it is due to the score calc in my own native script ...

On May 18, 11:51 am, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:

> I'm getting in one of my test cases the following error when searching  
> but maybe it is again already fixed 🙂
> 
> Exception in thread "elasticsearch[search]-pool-3-thread-2"  
> java.lang.AssertionError  
> at org.apache.lucene.search.TopScoreDocCollector  
> $InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:50)  
> at org.apache.lucene.search.Scorer.score(Scorer.java:90)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 519)  
> at  
> org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:  
> 174)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 384)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 291)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> 279)  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:  
> 211)  
> at  
> org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:  
> 222)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:  
> 134)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction  
> $AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:  
> 76)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> $BaseAsyncAction.access$000(TransportSearchTypeAction.java:75)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> $BaseAsyncAction$2.run(TransportSearchTypeAction.java:169)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 18, 2011, 9:55am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429/4 "2011-05-18T09:55:05Z")

</div>

Right, just wanted to suggest that :). The collector can't handle negative Float.NEGATIVE\_INFINITY or Nan values.  
On Wednesday, May 18, 2011 at 12:54 PM, Karussell wrote:

> ah, it is due to the score calc in my own native script ...
> 
> On May 18, 11:51 am, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:
> 
> > I'm getting in one of my test cases the following error when searching  
> > but maybe it is again already fixed 🙂
> > 
> > Exception in thread "elasticsearch[search]-pool-3-thread-2"  
> > java.lang.AssertionError  
> > at org.apache.lucene.search.TopScoreDocCollector  
> > $InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:50)  
> > at org.apache.lucene.search.Scorer.score(Scorer.java:90)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 519)  
> > at  
> > org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:  
> > 174)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 384)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 291)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 279)  
> > at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:  
> > 211)  
> > at  
> > org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:  
> > 222)  
> > at  
> > org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:  
> > 134)  
> > at  
> > org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction  
> > $AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:  
> > 76)  
> > at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> > $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)  
> > at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> > $BaseAsyncAction.access$000(TransportSearchTypeAction.java:75)  
> > at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> > $BaseAsyncAction$2.run(TransportSearchTypeAction.java:169)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [May 18, 2011, 9:56am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429/5 "2011-05-18T09:56:13Z")

</div>

ups my score got == -Infinity ... so solved 😉

On May 18, 11:54 am, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:

> ah, it is due to the score calc in my own native script ...
> 
> On May 18, 11:51 am, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:
> 
> > I'm getting in one of my test cases the following error when searching  
> > but maybe it is again already fixed 🙂
> 
> > Exception in thread "elasticsearch[search]-pool-3-thread-2"  
> > java.lang.AssertionError  
> > at org.apache.lucene.search.TopScoreDocCollector  
> > $InOrderTopScoreDocCollector.collect(TopScoreDocCollector.java:50)  
> > at org.apache.lucene.search.Scorer.score(Scorer.java:90)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 519)  
> > at  
> > org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:  
> > 174)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 384)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 291)  
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:  
> > 279)  
> > at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:  
> > 211)  
> > at  
> > org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:  
> > 222)  
> > at  
> > org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:  
> > 134)  
> > at  
> > org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction  
> > $AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:  
> > 76)  
> > at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> > $BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)  
> > at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> > $BaseAsyncAction.access$000(TransportSearchTypeAction.java:75)  
> > at org.elasticsearch.action.search.type.TransportSearchTypeAction  
> > $BaseAsyncAction$2.run(TransportSearchTypeAction.java:169)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:662)

---

<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, 4:05am UTC](https://discuss.elastic.co/t/assertionerror-at-topscoredoccollector-inordertopscoredoccollector-collect/4429/6 "2017-07-06T04:05:52Z")

</div>


