# Sudden ReduceSearchPhaseException while trying to sort on a date field, got resolved after restart

**URL:** <https://discuss.elastic.co/t/sudden-reducesearchphaseexception-while-trying-to-sort-on-a-date-field-got-resolved-after-restart/22896>\
**Category:** Elasticsearch\
**Created:** [March 25, 2015, 3:27pm UTC](https://discuss.elastic.co/t/sudden-reducesearchphaseexception-while-trying-to-sort-on-a-date-field-got-resolved-after-restart/22896 "2015-03-25T15:27:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subhradeep\_Das](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Subhradeep\_Das](https://discuss.elastic.co/u/Subhradeep_Das)\
**Post date:** [March 25, 2015, 3:27pm UTC](https://discuss.elastic.co/t/sudden-reducesearchphaseexception-while-trying-to-sort-on-a-date-field-got-resolved-after-restart/22896/1 "2015-03-25T15:27:46Z")

</div>

Hi,

I am using elastic search 1.1.1 version. While I was trying to query on one  
of my index , suddenly it started giving ReduceSearchPhaseException for a  
sorting query on particular field . Before this the same query had no issue  
. Also surprisingly when I restarted all my nodes the issue got resolved  
and it is working fine. Also without the sort on that particular field it  
was running good.

My query was as below,

{"query":{"match\_all":{}},  
"size":100,  
"sort" : [ {  
"updatedOn" : {  
"order" : "desc",  
"ignore\_unmapped" : true  
}  
} ]  
}

where the updatedOn field has the following mapping,

"updatedOn":{  
"type":"date",  
"format":"yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||yyyy-MM-dd HH:mm:ss"  
}

The exception I am getting is,

org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to  
execute phase [query], [reduce]  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:248)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onResult(TransportSearchTypeAction.java:219)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onResult(TransportSearchTypeAction.java:216)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.search.action.SearchServiceTransportAction$4.handleResponse(SearchServiceTransportAction.java:217)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.search.action.SearchServiceTransportAction$4.handleResponse(SearchServiceTransportAction.java:208)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handleResponse(MessageChannelHandler.java:154)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
~[elasticsearch-1.1.1.jar:na]  
at  
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)  
~[elasticsearch-1.1.1.jar:na]  
at org.elasticsearch.commo

As per my understanding, this ReduceSearchPhaseException comes when we try  
to facet/sort on a field where all the values for that field are not of  
same type. But here in this case as I have a mapping , there is no chance  
of having some different type value in the updatedOn field.

Can someone tell me when this type of exception comes ? And why it got  
resolved on server restart ? Is it some kind of bug in the ES version or  
there is some other reason?

Thanks  
Subhro

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/417cfc78-ed93-442a-b58f-227095035ff6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/417cfc78-ed93-442a-b58f-227095035ff6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:24am UTC](https://discuss.elastic.co/t/sudden-reducesearchphaseexception-while-trying-to-sort-on-a-date-field-got-resolved-after-restart/22896/2 "2017-07-06T00:24:01Z")

</div>


