# Getting Exception on an instance in EC2 while local VirtualBox instance works fine

**URL:** <https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912>\
**Category:** Elasticsearch\
**Created:** [March 6, 2012, 4:14pm UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912 "2012-03-06T16:14:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [March 6, 2012, 4:14pm UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912/1 "2012-03-06T16:14:11Z")

</div>

Hello ElasticSearch users!

I just thought that someone here can help me out with some challenges I am  
facing with my staging ES instance hosted in EC2.

Below is the gist URL

> <https://gist.github.com/juneym/58ca93e6f91489c7dc90>

By the way, I am running 0.17.6 and I've got NO issue running on local  
virtualbox instance. However, the EC2 instane is a bit of a problem.  
Please see below for details (sorry this is a bit long).

Below is the mapping for "biz"  
{  
biz: {  
properties: {  
tags: {  
index: not\_analyzed  
store: yes  
type: string  
}  
id: {  
type: string  
}  
content: {  
index\_analyzer: ascAnalyzer1  
store: yes  
search\_analyzer: standard  
boost: 2  
term\_vector: with\_positions\_offsets  
type: string  
}  
dtmPosted: {  
format: yyyy-MM-dd HH:mm:ss  
type: date  
}  
username: {  
index: not\_analyzed  
type: string  
}  
title: {  
index\_analyzer: ascAnalyzer1  
store: yes  
search\_analyzer: standard  
boost: 3  
term\_vector: with\_positions\_offsets  
type: string  
}  
dtmUpdated: {  
format: yyyy-MM-dd HH:mm:ss  
type: date  
}  
classId: {  
type: string  
}  
titlesrt: {  
index: not\_analyzed  
store: yes  
type: string  
}  
categories: {  
index: not\_analyzed  
type: string  
}  
rating: {  
store: yes  
type: integer  
}  
country: {  
index: not\_analyzed  
store: yes  
type: string  
}  
}  
}  
}

* * *

## When trying to sort by rating -- this works on my local copy I've seen this working before. Should I check all of the item in my Index for any non-numeric values?

index: bigdataidx  
shard: 3  
status: 500  
reason: QueryPhaseExecutionException[[bigdataidx][3]:  
query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"rating":  
org.elasticsearch.index.field.data.ints.IntFieldDataType$1@667ce8a8\>!]:  
Query Failed [Failed to execute main query]]; nested:  
NumberFormatException[Invalid shift value in prefixCoded string (is encoded  
value really an INT?)];

* * *

## When trying to sort by titlesrt - this is another weird case. The titlesrt field is not analyzed so multiple tokens should never occur right? But ES is complaining.

index: bigdataidx  
shard: 3  
status: 500  
reason: QueryPhaseExecutionException[[bigdataidx][3]:  
query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"titlesrt":  
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@147f549c\>!]:  
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];

---

<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:** [March 6, 2012, 8:48pm UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912/2 "2012-03-06T20:48:20Z")

</div>

Is there a chance that your mappings are not applied correctly? Can you issue get mapping and verify?

On Tuesday, March 6, 2012 at 6:14 PM, Raul, Jr. Martinez wrote:

> Hello Elasticsearch users!
> 
> I just thought that someone here can help me out with some challenges I am facing with my staging ES instance hosted in EC2.
> 
> Below is the gist URLhttps://gist.github.com/58ca93e6f91489c7dc90
> 
> By the way, I am running 0.17.6 and I've got NO issue running on local virtualbox instance. However, the EC2 instane is a bit of a problem.  
> Please see below for details (sorry this is a bit long).
> 
> Below is the mapping for "biz"  
> {  
> biz: {  
> properties: {  
> tags: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> id: {  
> type: string  
> }  
> content: {  
> index\_analyzer: ascAnalyzer1  
> store: yes  
> search\_analyzer: standard  
> boost: 2  
> term\_vector: with\_positions\_offsets  
> type: string  
> }  
> dtmPosted: {  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> username: {  
> index: not\_analyzed  
> type: string  
> }  
> title: {  
> index\_analyzer: ascAnalyzer1  
> store: yes  
> search\_analyzer: standard  
> boost: 3  
> term\_vector: with\_positions\_offsets  
> type: string  
> }  
> dtmUpdated: {  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> classId: {  
> type: string  
> }  
> titlesrt: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> categories: {  
> index: not\_analyzed  
> type: string  
> }  
> rating: {  
> store: yes  
> type: integer  
> }  
> country: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> }  
> }  
> }
> 
> * * *
> 
> ## When trying to sort by rating -- this works on my local copy I've seen this working before. Should I check all of the item in my Index for any non-numeric values?
> 
> index: bigdataidx  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"rating": org.elasticsearch.index.field.data.ints.IntFieldDataType$1@667ce8a8\>!]: Query Failed [Failed to execute main query]]; nested: NumberFormatException[Invalid shift value in prefixCoded string (is encoded value really an INT?)];
> 
> * * *
> 
> ## When trying to sort by titlesrt - this is another weird case. The titlesrt field is not analyzed so multiple tokens should never occur right? But ES is complaining.
> 
> index: bigdataidx  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"titlesrt": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@147f549c\>!]: 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];

---

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [March 7, 2012, 11:09am UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912/3 "2012-03-07T11:09:20Z")

</div>

On Wednesday, March 7, 2012 4:48:20 AM UTC+8, kimchy wrote:

> Is there a chance that your mappings are not applied correctly? Can you  
> issue get mapping and verify?

Below is the mapping for "biz" that I got from the Ec2 instance.

{  
"biz": {  
"properties": {  
"tags": {  
"index": "not\_analyzed",  
"store": "yes",  
"type": "string"  
},  
"id": {  
"type": "string"  
},  
"content": {  
"index\_analyzer": "ascAnalyzer1",  
"store": "yes",  
"search\_analyzer": "standard",  
"boost": 2,  
"term\_vector": "with\_positions\_offsets",  
"type": "string"  
},  
"dtmPosted": {  
"format": "yyyy-MM-dd HH:mm:ss",  
"type": "date"  
},  
"username": {  
"index": "not\_analyzed",  
"type": "string"  
},  
"title": {  
"index\_analyzer": "ascAnalyzer1",  
"store": "yes",  
"search\_analyzer": "standard",  
"boost": 3,  
"term\_vector": "with\_positions\_offsets",  
"type": "string"  
},  
"dtmUpdated": {  
"format": "yyyy-MM-dd HH:mm:ss",  
"type": "date"  
},  
"classId": {  
"type": "string"  
},  
"titlesrt": {  
"index": "not\_analyzed",  
"store": "yes",  
"type": "string"  
},  
"categories": {  
"index": "not\_analyzed",  
"type": "string"  
},  
"rating": {  
"store": "yes",  
"type": "integer"  
},  
"country": {  
"index": "not\_analyzed",  
"store": "yes",  
"type": "string"  
}  
}  
}  
}

And following is the log that is being generated when trying to sort by  
"rating" or "titlesrt".

[2012-03-07 06:06:16,212][DEBUG][action.search.type] [Ocean]  
[bigdataidx][3], node[Wa\_\_HC46RKSiSNWf6koz7A], [P], s[STARTED]: Failed to  
execute [org.elasticsearch.action.search.SearchRequest@3a4ee4f9]

org.elasticsearch.search.query.QueryPhaseExecutionException:  
[bigdataidx][3]:  
query[ConstantScore(_:_)],from[0],size[10],sort[\<custom:"rating":  
org.elasticsearch.index.field.data.ints.IntFieldDataType$1@60edef2\>!]:  
Query Failed [Failed to execute main query]

at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)

at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)

at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)

at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)

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:679)

Caused by: java.lang.NumberFormatException: Invalid shift value in  
prefixCoded string (is encoded value really an INT?)

at  
org.apache.lucene.util.NumericUtils.prefixCodedToInt(NumericUtils.java:232)

at org.apache.lucene.search.FieldCache$7.parseInt(FieldCache.java:242)

at  
org.elasticsearch.index.field.data.ints.IntFieldData$IntTypeLoader.collectTerm(IntFieldData.java:137)

at  
org.elasticsearch.index.field.data.support.FieldDataLoader.load(FieldDataLoader.java:54)

at  
org.elasticsearch.index.field.data.ints.IntFieldData.load(IntFieldData.java:123)

at  
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:81)

at  
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:33)

at org.elasticsearch.index.field.data.FieldData.load(FieldData.java:110)

at  
org.elasticsearch.index.cache.field.data.support.AbstractConcurrentMapFieldDataCache.cache(AbstractConcurrentMapFieldDataCache.java:112)

at  
org.elasticsearch.index.field.data.support.NumericFieldDataComparator.setNextReader(NumericFieldDataComparator.java:49)

at  
org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:95)

at  
org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:62)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:523)

at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:198)

at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:153)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)

at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:215)

... 9 more

[2012-03-07 06:06:44,352][DEBUG][action.search.type] [Ocean]  
[bigdataidx][3], node[Wa\_\_HC46RKSiSNWf6koz7A], [P], s[STARTED]: Failed to  
execute [org.elasticsearch.action.search.SearchRequest@d7ce85b]

org.elasticsearch.search.query.QueryPhaseExecutionException:  
[bigdataidx][3]:  
query[ConstantScore(_:_)],from[0],size[10],sort[\<custom:"titlesrt":  
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@1e8e41b9\>]:  
Query Failed [Failed to execute main query]

at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)

at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)

at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)

at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)

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:679)

Caused by: java.io.IOException: Can't sort on string types with more than  
one value per doc, or more than one token per field

at  
org.elasticsearch.index.field.data.strings.StringOrdValFieldDataComparator.setNextReader(StringOrdValFieldDataComparator.java:119)

at  
org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:95)

at  
org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:62)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:523)

at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:198)

at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:153)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)

at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:215)

... 9 more

[2012-03-07 06:06:53,028][DEBUG][action.search.type] [Ocean]  
[bigdataidx][3], node[Wa\_\_HC46RKSiSNWf6koz7A], [P], s[STARTED]: Failed to  
execute [org.elasticsearch.action.search.SearchRequest@29f55ee]

org.elasticsearch.search.query.QueryPhaseExecutionException:  
[bigdataidx][3]:  
query[ConstantScore(_:_)],from[0],size[10],sort[\<custom:"titlesrt":  
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@668e368c\>]:  
Query Failed [Failed to execute main query]

at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)

at  
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)

at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)

at  
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)

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:679)

Caused by: java.io.IOException: Can't sort on string types with more than  
one value per doc, or more than one token per field

at  
org.elasticsearch.index.field.data.strings.StringOrdValFieldDataComparator.setNextReader(StringOrdValFieldDataComparator.java:119)

at  
org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:95)

at  
org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:62)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:523)

at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:198)

at  
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:153)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)

at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)

at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:215)

... 9 more

> On Tuesday, March 6, 2012 at 6:14 PM, Raul, Jr. Martinez wrote:
> 
> Hello Elasticsearch users!
> 
> I just thought that someone here can help me out with some challenges I am  
> facing with my staging ES instance hosted in EC2.
> 
> Below is the gist URL  
> [weird elasticsearch error · GitHub](https://gist.github.com/58ca93e6f91489c7dc90)
> 
> By the way, I am running 0.17.6 and I've got NO issue running on local  
> virtualbox instance. However, the EC2 instane is a bit of a problem.  
> Please see below for details (sorry this is a bit long).
> 
> Below is the mapping for "biz"  
> {  
> biz: {  
> properties: {  
> tags: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> id: {  
> type: string  
> }  
> content: {  
> index\_analyzer: ascAnalyzer1  
> store: yes  
> search\_analyzer: standard  
> boost: 2  
> term\_vector: with\_positions\_offsets  
> type: string  
> }  
> dtmPosted: {  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> username: {  
> index: not\_analyzed  
> type: string  
> }  
> title: {  
> index\_analyzer: ascAnalyzer1  
> store: yes  
> search\_analyzer: standard  
> boost: 3  
> term\_vector: with\_positions\_offsets  
> type: string  
> }  
> dtmUpdated: {  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> classId: {  
> type: string  
> }  
> titlesrt: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> categories: {  
> index: not\_analyzed  
> type: string  
> }  
> rating: {  
> store: yes  
> type: integer  
> }  
> country: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> }  
> }  
> }
> 
> * * *
> 
> ## When trying to sort by rating -- this works on my local copy I've seen this working before. Should I check all of the item in my Index for any non-numeric values?
> 
> index: bigdataidx  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[bigdataidx][3]:  
> query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"rating":  
> org.elasticsearch.index.field.data.ints.IntFieldDataType$1@667ce8a8\>!]:  
> Query Failed [Failed to execute main query]]; nested:  
> NumberFormatException[Invalid shift value in prefixCoded string (is encoded  
> value really an INT?)];
> 
> * * *
> 
> ## When trying to sort by titlesrt - this is another weird case. The titlesrt field is not analyzed so multiple tokens should never occur right? But ES is complaining.
> 
> index: bigdataidx  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[bigdataidx][3]:  
> query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"titlesrt":  
> org.elasticsearch.index.field.data.strings.StringFieldDataType$1@147f549c\>!]:  
> 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];

On Wednesday, March 7, 2012 4:48:20 AM UTC+8, kimchy wrote:

> Is there a chance that your mappings are not applied correctly? Can you  
> issue get mapping and verify?
> 
> On Tuesday, March 6, 2012 at 6:14 PM, Raul, Jr. Martinez wrote:
> 
> Hello Elasticsearch users!
> 
> I just thought that someone here can help me out with some challenges I am  
> facing with my staging ES instance hosted in EC2.
> 
> Below is the gist URL  
> [weird elasticsearch error · GitHub](https://gist.github.com/58ca93e6f91489c7dc90)
> 
> By the way, I am running 0.17.6 and I've got NO issue running on local  
> virtualbox instance. However, the EC2 instane is a bit of a problem.  
> Please see below for details (sorry this is a bit long).
> 
> Below is the mapping for "biz"  
> {  
> biz: {  
> properties: {  
> tags: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> id: {  
> type: string  
> }  
> content: {  
> index\_analyzer: ascAnalyzer1  
> store: yes  
> search\_analyzer: standard  
> boost: 2  
> term\_vector: with\_positions\_offsets  
> type: string  
> }  
> dtmPosted: {  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> username: {  
> index: not\_analyzed  
> type: string  
> }  
> title: {  
> index\_analyzer: ascAnalyzer1  
> store: yes  
> search\_analyzer: standard  
> boost: 3  
> term\_vector: with\_positions\_offsets  
> type: string  
> }  
> dtmUpdated: {  
> format: yyyy-MM-dd HH:mm:ss  
> type: date  
> }  
> classId: {  
> type: string  
> }  
> titlesrt: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> categories: {  
> index: not\_analyzed  
> type: string  
> }  
> rating: {  
> store: yes  
> type: integer  
> }  
> country: {  
> index: not\_analyzed  
> store: yes  
> type: string  
> }  
> }  
> }  
> }
> 
> * * *
> 
> ## When trying to sort by rating -- this works on my local copy I've seen this working before. Should I check all of the item in my Index for any non-numeric values?
> 
> index: bigdataidx  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[bigdataidx][3]:  
> query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"rating":  
> org.elasticsearch.index.field.data.ints.IntFieldDataType$1@667ce8a8\>!]:  
> Query Failed [Failed to execute main query]]; nested:  
> NumberFormatException[Invalid shift value in prefixCoded string (is encoded  
> value really an INT?)];
> 
> * * *
> 
> ## When trying to sort by titlesrt - this is another weird case. The titlesrt field is not analyzed so multiple tokens should never occur right? But ES is complaining.
> 
> index: bigdataidx  
> shard: 3  
> status: 500  
> reason: QueryPhaseExecutionException[[bigdataidx][3]:  
> query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"titlesrt":  
> org.elasticsearch.index.field.data.strings.StringFieldDataType$1@147f549c\>!]:  
> 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];

---

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [March 7, 2012, 11:48am UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912/4 "2012-03-07T11:48:02Z")

</div>

On Wednesday, March 7, 2012 4:48:20 AM UTC+8, kimchy wrote:

> Is there a chance that your mappings are not applied correctly? Can you  
> issue get mapping and verify?

Hello Shay,

Actually, I checked the global mapping and I found out that there are other  
index types with the same fields "titlesrt" and "ratings" but the mapping  
was not properly set. So that actually affected the specific query to BIZ.  
I am not sure if this is a normal behavior or a BUG that was fixed prior to  
0.19.0.

My impression is since my query is specific to "biz", mapping of other  
index types is not to be considered.

The issue is now resolved but just want to share this findings to the  
users. Thanks!

Regards,

Raul

> On Tuesday, March 6, 2012 at 6:14 PM, Raul, Jr. Martinez wrote:
> 
> Hello Elasticsearch users!
> 
> I just thought that someone here can help me out with some challenges I am  
> facing with my staging ES instance hosted in EC2.
> 
> Below is the gist URL  
> [weird elasticsearch error · GitHub](https://gist.github.com/58ca93e6f91489c7dc90)
> 
> By the way, I am running 0.17.6 and I've got NO issue running on local  
> virtualbox instance. However, the EC2 instane is a bit of a problem.  
> Please see below for details (sorry this is a bit long).

---

<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:** [March 7, 2012, 11:49am UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912/5 "2012-03-07T11:49:58Z")

</div>

Is there a chance that you have in the index another mapping with a field called rating with a different type?

On Wednesday, March 7, 2012 at 1:09 PM, Raul, Jr. Martinez wrote:

> On Wednesday, March 7, 2012 4:48:20 AM UTC+8, kimchy wrote:
> 
> > Is there a chance that your mappings are not applied correctly? Can you issue get mapping and verify?
> 
> Below is the mapping for "biz" that I got from the Ec2 instance.
> 
> {  
> "biz": {  
> "properties": {  
> "tags": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "type": "string"  
> },  
> "id": {  
> "type": "string"  
> },  
> "content": {  
> "index\_analyzer": "ascAnalyzer1",  
> "store": "yes",  
> "search\_analyzer": "standard",  
> "boost": 2,  
> "term\_vector": "with\_positions\_offsets",  
> "type": "string"  
> },  
> "dtmPosted": {  
> "format": "yyyy-MM-dd HH:mm:ss",  
> "type": "date"  
> },  
> "username": {  
> "index": "not\_analyzed",  
> "type": "string"  
> },  
> "title": {  
> "index\_analyzer": "ascAnalyzer1",  
> "store": "yes",  
> "search\_analyzer": "standard",  
> "boost": 3,  
> "term\_vector": "with\_positions\_offsets",  
> "type": "string"  
> },  
> "dtmUpdated": {  
> "format": "yyyy-MM-dd HH:mm:ss",  
> "type": "date"  
> },  
> "classId": {  
> "type": "string"  
> },  
> "titlesrt": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "type": "string"  
> },  
> "categories": {  
> "index": "not\_analyzed",  
> "type": "string"  
> },  
> "rating": {  
> "store": "yes",  
> "type": "integer"  
> },  
> "country": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "type": "string"  
> }  
> }  
> }  
> }
> 
> And following is the log that is being generated when trying to sort by "rating" or "titlesrt".
> 
> [2012-03-07 06:06:16,212][DEBUG][action.search.type] [Ocean] [bigdataidx][3], node[Wa\_\_HC46RKSiSNWf6koz7A], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@3a4ee4f9]  
> org.elasticsearch.search.query.QueryPhaseExecutionException: [bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10],sort[\<custom:"rating": org.elasticsearch.index.field.data.ints.IntFieldDataType$1@60edef2\>!]: Query Failed [Failed to execute main query]  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)  
> at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)  
> at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
> 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:679)  
> Caused by: java.lang.NumberFormatException: Invalid shift value in prefixCoded string (is encoded value really an INT?)  
> at org.apache.lucene.util.NumericUtils.prefixCodedToInt(NumericUtils.java:232)  
> at org.apache.lucene.search.FieldCache$7.parseInt(FieldCache.java:242)  
> at org.elasticsearch.index.field.data.ints.IntFieldData$IntTypeLoader.collectTerm(IntFieldData.java:137)  
> at org.elasticsearch.index.field.data.support.FieldDataLoader.load(FieldDataLoader.java:54)  
> at org.elasticsearch.index.field.data.ints.IntFieldData.load(IntFieldData.java:123)  
> at org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:81)  
> at org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:33)  
> at org.elasticsearch.index.field.data.FieldData.load(FieldData.java:110)  
> at org.elasticsearch.index.cache.field.data.support.AbstractConcurrentMapFieldDataCache.cache(AbstractConcurrentMapFieldDataCache.java:112)  
> at org.elasticsearch.index.field.data.support.NumericFieldDataComparator.setNextReader(NumericFieldDataComparator.java:49)  
> at org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:95)  
> at org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:62)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:523)  
> at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:198)  
> at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:153)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:215)  
> ... 9 more
> 
> [2012-03-07 06:06:44,352][DEBUG][action.search.type] [Ocean] [bigdataidx][3], node[Wa\_\_HC46RKSiSNWf6koz7A], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@d7ce85b]  
> org.elasticsearch.search.query.QueryPhaseExecutionException: [bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10],sort[\<custom:"titlesrt": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@1e8e41b9\>]: Query Failed [Failed to execute main query]  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)  
> at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)  
> at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
> 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:679)  
> Caused by: java.io.IOException: Can't sort on string types with more than one value per doc, or more than one token per field  
> at org.elasticsearch.index.field.data.strings.StringOrdValFieldDataComparator.setNextReader(StringOrdValFieldDataComparator.java:119)  
> at org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:95)  
> at org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:62)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:523)  
> at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:198)  
> at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:153)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:215)  
> ... 9 more  
> [2012-03-07 06:06:53,028][DEBUG][action.search.type] [Ocean] [bigdataidx][3], node[Wa\_\_HC46RKSiSNWf6koz7A], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@29f55ee]  
> org.elasticsearch.search.query.QueryPhaseExecutionException: [bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10],sort[\<custom:"titlesrt": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@668e368c\>]: Query Failed [Failed to execute main query]  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:221)  
> at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)  
> at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:134)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
> 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:679)  
> Caused by: java.io.IOException: Can't sort on string types with more than one value per doc, or more than one token per field  
> at org.elasticsearch.index.field.data.strings.StringOrdValFieldDataComparator.setNextReader(StringOrdValFieldDataComparator.java:119)  
> at org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:95)  
> at org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:62)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:523)  
> at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:198)  
> at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:153)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)  
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)  
> at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:215)  
> ... 9 more
> 
> > On Tuesday, March 6, 2012 at 6:14 PM, Raul, Jr. Martinez wrote:
> > 
> > > Hello Elasticsearch users!
> > > 
> > > I just thought that someone here can help me out with some challenges I am facing with my staging ES instance hosted in EC2.
> > > 
> > > Below is the gist URLhttps://gist.github.com/58ca93e6f91489c7dc90
> > > 
> > > By the way, I am running 0.17.6 and I've got NO issue running on local virtualbox instance. However, the EC2 instane is a bit of a problem.  
> > > Please see below for details (sorry this is a bit long).
> > > 
> > > Below is the mapping for "biz"  
> > > {  
> > > biz: {  
> > > properties: {  
> > > tags: {  
> > > index: not\_analyzed  
> > > store: yes  
> > > type: string  
> > > }  
> > > id: {  
> > > type: string  
> > > }  
> > > content: {  
> > > index\_analyzer: ascAnalyzer1  
> > > store: yes  
> > > search\_analyzer: standard  
> > > boost: 2  
> > > term\_vector: with\_positions\_offsets  
> > > type: string  
> > > }  
> > > dtmPosted: {  
> > > format: yyyy-MM-dd HH:mm:ss  
> > > type: date  
> > > }  
> > > username: {  
> > > index: not\_analyzed  
> > > type: string  
> > > }  
> > > title: {  
> > > index\_analyzer: ascAnalyzer1  
> > > store: yes  
> > > search\_analyzer: standard  
> > > boost: 3  
> > > term\_vector: with\_positions\_offsets  
> > > type: string  
> > > }  
> > > dtmUpdated: {  
> > > format: yyyy-MM-dd HH:mm:ss  
> > > type: date  
> > > }  
> > > classId: {  
> > > type: string  
> > > }  
> > > titlesrt: {  
> > > index: not\_analyzed  
> > > store: yes  
> > > type: string  
> > > }  
> > > categories: {  
> > > index: not\_analyzed  
> > > type: string  
> > > }  
> > > rating: {  
> > > store: yes  
> > > type: integer  
> > > }  
> > > country: {  
> > > index: not\_analyzed  
> > > store: yes  
> > > type: string  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > * * *
> > > 
> > > ## When trying to sort by rating -- this works on my local copy I've seen this working before. Should I check all of the item in my Index for any non-numeric values?
> > > 
> > > index: bigdataidx  
> > > shard: 3  
> > > status: 500  
> > > reason: QueryPhaseExecutionException[[bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"rating": org.elasticsearch.index.field.data.ints.IntFieldDataType$1@667ce8a8\>!]: Query Failed [Failed to execute main query]]; nested: NumberFormatException[Invalid shift value in prefixCoded string (is encoded value really an INT?)];
> > > 
> > > * * *
> > > 
> > > ## When trying to sort by titlesrt - this is another weird case. The titlesrt field is not analyzed so multiple tokens should never occur right? But ES is complaining.
> > > 
> > > index: bigdataidx  
> > > shard: 3  
> > > status: 500  
> > > reason: QueryPhaseExecutionException[[bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"titlesrt": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@147f549c\>!]: 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];
> 
> On Wednesday, March 7, 2012 4:48:20 AM UTC+8, kimchy wrote:
> 
> > Is there a chance that your mappings are not applied correctly? Can you issue get mapping and verify?
> > 
> > On Tuesday, March 6, 2012 at 6:14 PM, Raul, Jr. Martinez wrote:
> > 
> > > Hello Elasticsearch users!
> > > 
> > > I just thought that someone here can help me out with some challenges I am facing with my staging ES instance hosted in EC2.
> > > 
> > > Below is the gist URLhttps://gist.github.com/58ca93e6f91489c7dc90
> > > 
> > > By the way, I am running 0.17.6 and I've got NO issue running on local virtualbox instance. However, the EC2 instane is a bit of a problem.  
> > > Please see below for details (sorry this is a bit long).
> > > 
> > > Below is the mapping for "biz"  
> > > {  
> > > biz: {  
> > > properties: {  
> > > tags: {  
> > > index: not\_analyzed  
> > > store: yes  
> > > type: string  
> > > }  
> > > id: {  
> > > type: string  
> > > }  
> > > content: {  
> > > index\_analyzer: ascAnalyzer1  
> > > store: yes  
> > > search\_analyzer: standard  
> > > boost: 2  
> > > term\_vector: with\_positions\_offsets  
> > > type: string  
> > > }  
> > > dtmPosted: {  
> > > format: yyyy-MM-dd HH:mm:ss  
> > > type: date  
> > > }  
> > > username: {  
> > > index: not\_analyzed  
> > > type: string  
> > > }  
> > > title: {  
> > > index\_analyzer: ascAnalyzer1  
> > > store: yes  
> > > search\_analyzer: standard  
> > > boost: 3  
> > > term\_vector: with\_positions\_offsets  
> > > type: string  
> > > }  
> > > dtmUpdated: {  
> > > format: yyyy-MM-dd HH:mm:ss  
> > > type: date  
> > > }  
> > > classId: {  
> > > type: string  
> > > }  
> > > titlesrt: {  
> > > index: not\_analyzed  
> > > store: yes  
> > > type: string  
> > > }  
> > > categories: {  
> > > index: not\_analyzed  
> > > type: string  
> > > }  
> > > rating: {  
> > > store: yes  
> > > type: integer  
> > > }  
> > > country: {  
> > > index: not\_analyzed  
> > > store: yes  
> > > type: string  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > * * *
> > > 
> > > ## When trying to sort by rating -- this works on my local copy I've seen this working before. Should I check all of the item in my Index for any non-numeric values?
> > > 
> > > index: bigdataidx  
> > > shard: 3  
> > > status: 500  
> > > reason: QueryPhaseExecutionException[[bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"rating": org.elasticsearch.index.field.data.ints.IntFieldDataType$1@667ce8a8\>!]: Query Failed [Failed to execute main query]]; nested: NumberFormatException[Invalid shift value in prefixCoded string (is encoded value really an INT?)];
> > > 
> > > * * *
> > > 
> > > ## When trying to sort by titlesrt - this is another weird case. The titlesrt field is not analyzed so multiple tokens should never occur right? But ES is complaining.
> > > 
> > > index: bigdataidx  
> > > shard: 3  
> > > status: 500  
> > > reason: QueryPhaseExecutionException[[bigdataidx][3]: query[ConstantScore(_:_)],from[0],size[10000],sort[\<custom:"titlesrt": org.elasticsearch.index.field.data.strings.StringFieldDataType$1@147f549c\>!]: 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];

---

<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:36am UTC](https://discuss.elastic.co/t/getting-exception-on-an-instance-in-ec2-while-local-virtualbox-instance-works-fine/6912/6 "2017-07-06T03:36:52Z")

</div>


