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


(Raul, Jr. Martinez) #1

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

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];


(Shay Banon) #2

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];


(Raul, Jr. Martinez) #3

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
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
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];


(Raul, Jr. Martinez) #4

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
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).


(Shay Banon) #5

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];


(system) #6