# "failed to reduce search" error

**URL:** <https://discuss.elastic.co/t/failed-to-reduce-search-error/11946>\
**Category:** Elasticsearch\
**Created:** [May 14, 2013, 3:31am UTC](https://discuss.elastic.co/t/failed-to-reduce-search-error/11946 "2013-05-14T03:31:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [May 14, 2013, 3:31am UTC](https://discuss.elastic.co/t/failed-to-reduce-search-error/11946/1 "2013-05-14T03:31:38Z")

</div>

Hey,

A couple days ago, I started to get errors about shard failures, I can't  
remember the exact error message.  
So I decided to reindex everything from mysql and start fresh. I just  
delete all the old indexes, and reindexed.

Now, I get these errors:

[2013-05-14 03:27:24,007][DEBUG][action.search.type] [Zero-G] _failed  
to reduce search_  
org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to  
execute phase [fetch], [reduce]  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:177)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:155)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:149)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:346)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:149)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:136)  
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:722)  
_Caused by: java.lang.ClassCastException:  
org.elasticsearch.search.facet.terms.ints.InternalIntTermsFacet cannot be  
cast to org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet_  
at  
org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet.reduce(InternalLongTermsFacet.java:223)  
at  
org.elasticsearch.search.facet.terms.TermsFacetProcessor.reduce(TermsFacetProcessor.java:212)  
at  
org.elasticsearch.search.controller.SearchPhaseController.merge(SearchPhaseController.java:296)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.innerFinishHim(TransportSearchQueryThenFetchAction.java:190)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:175)

I did not change anything in the config files, ever, I'm just using the  
default config.

Any help would be appreciated! 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](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:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 14, 2013, 7:09am UTC](https://discuss.elastic.co/t/failed-to-reduce-search-error/11946/2 "2013-05-14T07:09:05Z")

</div>

Hey,

thanks for your report. Can you maybe provide some more information?

- Elasticsearch version used
- Some sample data indexed
- Query executed at that time

This would help a lot to reproduce your issue. The best would be, if you  
could reproduce it by using some curl calls.

--Alexander

On Tue, May 14, 2013 at 5:31 AM, Robin Boutros [niuage@gmail.com](mailto:niuage@gmail.com) wrote:

> Hey,
> 
> A couple days ago, I started to get errors about shard failures, I can't  
> remember the exact error message.  
> So I decided to reindex everything from mysql and start fresh. I just  
> delete all the old indexes, and reindexed.
> 
> Now, I get these errors:
> 
> [2013-05-14 03:27:24,007][DEBUG][action.search.type] [Zero-G] _failed  
> to reduce search_  
> org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to  
> execute phase [fetch], [reduce]  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:177)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:155)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:149)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:346)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:149)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:136)  
> 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:722)  
> _Caused by: java.lang.ClassCastException:  
> org.elasticsearch.search.facet.terms.ints.InternalIntTermsFacet cannot be  
> cast to org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet_  
> at  
> org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet.reduce(InternalLongTermsFacet.java:223)  
> at  
> org.elasticsearch.search.facet.terms.TermsFacetProcessor.reduce(TermsFacetProcessor.java:212)  
> at  
> org.elasticsearch.search.controller.SearchPhaseController.merge(SearchPhaseController.java:296)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.innerFinishHim(TransportSearchQueryThenFetchAction.java:190)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:175)
> 
> I did not change anything in the config files, ever, I'm just using the  
> default config.
> 
> Any help would be appreciated! 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [May 14, 2013, 3:26pm UTC](https://discuss.elastic.co/t/failed-to-reduce-search-error/11946/3 "2013-05-14T15:26:52Z")

</div>

Right, I should have given more info 😉

ES version: 0.20.5

But actually, I noticed other errors that made it clear what was wrong:  
nested: QueryParsingException[[poe\_shields] [nested] nested object under  
path [stats] is not of nested type]; }]","status":500}

I noticed that my mapping was actually wrong. What I think happened is that  
I had rake tasks running in the background using ES, and so when I deleted  
the old indexes, they were immediately recreated by Tire with a dynamic  
mapping. Really not sure, but I'm going to just stop everything, reindex,  
and see if everything is back to normal.

Thanks!

So it's not the error I posted above. Not sure how to reproduce this one. I  
also get other errors like "failed to parse date field".

On Monday, May 13, 2013 11:31:38 PM UTC-4, Robin Boutros wrote:

> Hey,
> 
> A couple days ago, I started to get errors about shard failures, I can't  
> remember the exact error message.  
> So I decided to reindex everything from mysql and start fresh. I just  
> delete all the old indexes, and reindexed.
> 
> Now, I get these errors:
> 
> [2013-05-14 03:27:24,007][DEBUG][action.search.type] [Zero-G] _failed  
> to reduce search_  
> org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to  
> execute phase [fetch], [reduce]  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:177)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:155)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:149)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:346)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:149)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:136)  
> 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:722)  
> _Caused by: java.lang.ClassCastException:  
> org.elasticsearch.search.facet.terms.ints.InternalIntTermsFacet cannot be  
> cast to org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet_  
> at  
> org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet.reduce(InternalLongTermsFacet.java:223)  
> at  
> org.elasticsearch.search.facet.terms.TermsFacetProcessor.reduce(TermsFacetProcessor.java:212)  
> at  
> org.elasticsearch.search.controller.SearchPhaseController.merge(SearchPhaseController.java:296)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.innerFinishHim(TransportSearchQueryThenFetchAction.java:190)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:175)
> 
> I did not change anything in the config files, ever, I'm just using the  
> default config.
> 
> Any help would be appreciated! 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](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:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [May 14, 2013, 8:20pm UTC](https://discuss.elastic.co/t/failed-to-reduce-search-error/11946/4 "2013-05-14T20:20:55Z")

</div>

That was it, my mapping was actually messed up. I reindexed the data  
properly and everything is working fine. No idea of what happened in the  
first place, but for now, I'm good.

Thanks.

On Monday, May 13, 2013 11:31:38 PM UTC-4, Robin Boutros wrote:

> Hey,
> 
> A couple days ago, I started to get errors about shard failures, I can't  
> remember the exact error message.  
> So I decided to reindex everything from mysql and start fresh. I just  
> delete all the old indexes, and reindexed.
> 
> Now, I get these errors:
> 
> [2013-05-14 03:27:24,007][DEBUG][action.search.type] [Zero-G] _failed  
> to reduce search_  
> org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to  
> execute phase [fetch], [reduce]  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:177)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:155)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:149)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:346)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:149)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:136)  
> 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:722)  
> _Caused by: java.lang.ClassCastException:  
> org.elasticsearch.search.facet.terms.ints.InternalIntTermsFacet cannot be  
> cast to org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet_  
> at  
> org.elasticsearch.search.facet.terms.longs.InternalLongTermsFacet.reduce(InternalLongTermsFacet.java:223)  
> at  
> org.elasticsearch.search.facet.terms.TermsFacetProcessor.reduce(TermsFacetProcessor.java:212)  
> at  
> org.elasticsearch.search.controller.SearchPhaseController.merge(SearchPhaseController.java:296)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.innerFinishHim(TransportSearchQueryThenFetchAction.java:190)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:175)
> 
> I did not change anything in the config files, ever, I'm just using the  
> default config.
> 
> Any help would be appreciated! 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](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:36am UTC](https://discuss.elastic.co/t/failed-to-reduce-search-error/11946/5 "2017-07-06T02:36:45Z")

</div>


