Hi,
I have a type user, where I have a field title for search and I added a
field sortable.title for sorting purpose, which is not_analyzed, its
mapping is as follows :
{"user":{
"properties":{
"sortable":{
"type":"object","properties":{
"title":{
"type":"string","index":"not_analyzed"
}
}
},
"title":{
"type":"string","index":"analyzed"
}
}
}
}
and now when I am running the query as follows :
{
"query":{
"match_all":{}
},
"sort":{
"sortable.title":"desc"
}
}
OR
{
"query":{
"text":{
"title":{
"type":"phrase_prefix","query":"nar"
}
}
},
"sort":{
"sortable.title":"desc"
}
}
its returning the following exception :
*{
- index: es_5
- shard: 1
- status: 500
- reason: QueryPhaseExecutionException[[es_5][1]:
query[ConstantScore(NotDeleted(:))],from[0],size[10],sort[<custom:"sortable.title":
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@3f28e2>]:
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];
},**{*
*
-
-
- index: es_5
- shard: 3
- status: 500
- reason: QueryPhaseExecutionException[[es_5][3]:
query[ConstantScore(NotDeleted(:))],from[0],size[10],sort[<custom:"sortable.title":
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@32e46a>]:
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];
}
- {
- index: es_5
- shard: 2
- status: 500
- reason: QueryPhaseExecutionException[[es_5][2]:
query[ConstantScore(NotDeleted(:))],from[0],size[10],sort[<custom:"sortable.title":
org.elasticsearch.index.field.data.strings.StringFieldDataType$1@13204e5>]:
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];
}
]
-
*}
It was working fine earlier with the old data, we just reimported the data
to elasticsearch, rather this time we strictly added mapping to every
field,and now its crashing on the same data.
*
*
*
*