I'm using icu_collation for phonebook sort, but getting a hash value in sort response in below search query
GET testindex1/_search
{
"sort": [
{
"id.sort_en": {
"order": "ASC",
"unmapped_type": "string"
}
}
]
}
"sort": [
"""ถ䵄䊃懥㢲Єᰃ䗜湡㜱㮀"""
]
But when i'm using keyword instead of sort_en, proper string value is showing up in sort response.
Due to this there are additional quotes are generated, and my json parsing is failing stating invalid json. Is there any other way to no show hash value, or convert to string format.
Below are the template, document, which i have used
{
"settings": {
"analysis": {
"filter": {
"ngram_filter": {
"type": "ngram",
"min_gram": 1,
"max_gram": 500
}
},
"analyzer": {
"index_analyzer": {
"tokenizer": "whitespace",
"filter": [
"ngram_filter",
"lowercase"
]
},
"search_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": "lowercase"
}
}
}
},
"mappings": {
"doc": {
"properties": {
"id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"sort_en": {
"type": "icu_collation_keyword",
"index": true,
"language": "en",
"country": "US",
"variant": "@collation=phonebook"
}
},
"analyzer": "index_analyzer",
"search_analyzer": "search_analyzer"
}
}
}
}
}
POST testindex1/doc/1
{
"id": "5CG0166X2M"
}
Any help would be appreciated.