Skip to content

Instantly share code, notes, and snippets.

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 KnowledgeGarden/4731b573f52f4458cbf8c104c96a196d to your computer and use it in GitHub Desktop.
Save KnowledgeGarden/4731b573f52f4458cbf8c104c96a196d to your computer and use it in GitHub Desktop.
Mapping issues
Error encountered:
co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/index] failed: [mapper_parsing_exception]
failed to parse field [details] of type [text] in document with id '1656187419178'. Preview of field's value: '{en=Funky label}'
Consider this JSON
{"lox":"1656187419178","details":{"en":"Funky label"},"label":{"en":"Funky label"}}
And this mappings template:
{
"mappings": {
"properties": {
"lox": {
"type": "keyword",
"store": true
},
"label": {
"type": "text",
"analyzer": "standard",
"fields": {
"en": {
"type": "text",
"analyzer": "english"
},
"fr": {
"type": "text",
"analyzer": "french"
},
"de": {
"type": "text",
"analyzer": "german"
}
}
},
"details": {
"type": "text",
"analyzer": "standard",
"fields" : {
"en": {
"type": "text",
"analyzer": "english",
"store": true
},
"fr": {
"type": "text",
"analyzer": "french",
"store": true
},
"de": {
"type": "text",
"analyzer": "german",
"store": true
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment