# Shard failure for the sorting case

**URL:** <https://discuss.elastic.co/t/shard-failure-for-the-sorting-case/6562>\
**Category:** Elasticsearch\
**Created:** [February 1, 2012, 10:41am UTC](https://discuss.elastic.co/t/shard-failure-for-the-sorting-case/6562 "2012-02-01T10:41:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [February 1, 2012, 10:41am UTC](https://discuss.elastic.co/t/shard-failure-for-the-sorting-case/6562/1 "2012-02-01T10:41:53Z")

</div>

```
   I am running the following query:

```

{  
"size": 10,  
"from": 0,  
"sort": {  
"is\_usa": {  
"order": "desc"  
},  
"state\_title": {  
"order": "asc"  
},  
"sortable.title": {  
"order": "asc"  
}  
},  
"query": {  
"match\_all": {}  
}  
}

and its giving me the following error:

{

- took: 10
- timed\_out: false
- \_shards: {
  - total: 5
  - successful: 4
  - failed: 1
  - failures: [
    - {
      - index: es\_5
      - shard: 3
      - status: 500
      - reason: QueryPhaseExecutionException[[es\_5][3]:  
query[filtered(ConstantScore(_:_))-\>FilterCacheFilterWrapper(\_type:IzapGeoCity)],from[0],size[10],sort[\<custom:"is\_usa":  
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@9dcf62\>!,\<custom:"state\_title":  
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@9a3166\>,\<custom:"sortable.title":  
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@12146d4\>]:  
Query Failed [Failed to execute main query]]; nested: IOException[Can't  
sort on string types with more than one value per doc, or more than one  
token per field];  
}  
]  
}

and if I remove the sorting on sortable.title, it gives all results. I dn't  
understand why the mapping in one shard is not available while it is in  
other four.

---

<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:** [February 1, 2012, 11:15am UTC](https://discuss.elastic.co/t/shard-failure-for-the-sorting-case/6562/2 "2012-02-01T11:15:07Z")

</div>

state\_title is analyzed, you need to have a version of it that is not analyzed to sort on it.

On Wednesday, February 1, 2012 at 12:41 PM, Narinder Kaur wrote:

> ```
> I am running the following query:
> 
> ```
> 
> {  
> "size": 10,  
> "from": 0,  
> "sort": {  
> "is\_usa": {  
> "order": "desc"  
> },  
> "state\_title": {  
> "order": "asc"  
> },  
> "sortable.title": {  
> "order": "asc"  
> }  
> },  
> "query": {  
> "match\_all": {}  
> }  
> }
> 
> and its giving me the following error:
> 
> {  
> took: 10  
> timed\_out: false  
> \_shards: {  
> total: 5  
> successful: 4  
> failed: 1  
> failures: [  
> {  
> index: es\_5  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[es\_5][3]: query[filtered(ConstantScore(_:_))-\>FilterCacheFilterWrapper(\_type:IzapGeoCity)],from[0],size[10],sort[\<custom:"is\_usa": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@9dcf62\>!,\<custom:"state\_title": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@9a3166\>,\<custom:"sortable.title": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@12146d4\>]: Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field];
> 
> }
> 
> ]
> 
> }
> 
> and if I remove the sorting on sortable.title, it gives all results. I dn't understand why the mapping in one shard is not available while it is in other four.

---

<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, 3:40am UTC](https://discuss.elastic.co/t/shard-failure-for-the-sorting-case/6562/3 "2017-07-06T03:40:50Z")

</div>


