Multi-language elastic search mapping setup Multi-language elastic search mapping setup elasticsearch elasticsearch

Multi-language elastic search mapping setup


If you match MongoDB object language property to the exact name of the ES language analyzers all you would be needing than as per the recommended by Elastic way you would just add:

{  "mappings": {    "article": {      "properties": {        "created": {          "type": "date"        },        "title": {          "type": "text",          "fields": {            "english": {              "type": "text",              "analyzer": "english"            },            "dutch": {              "type": "text",              "analyzer": "dutch"            },            "bulgarian": {              "type": "text",              "analyzer": "bulgarian"            }          }        }      }    }  }

This way you have nice match on the language/analyzer field between MongoDB and ES.