Skip to content

Instantly share code, notes, and snippets.

@juneym
Created March 6, 2012 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juneym/58ca93e6f91489c7dc90 to your computer and use it in GitHub Desktop.
Save juneym/58ca93e6f91489c7dc90 to your computer and use it in GitHub Desktop.
weird elasticsearch error
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.
------------------------------------------------
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.
------------------------------------------------
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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment