Will this document structure work for multiple language indexing?


(Shiv Naidu) #1

Hi All,

I am trying to create a mapping for my index that requires multiple language support. I found in the documentation there are two ways to do it, "support at the document level" or "field level".

{
  "settings": {
    "analysis": {...} 
  },
  "mappings": {
    "title": {
      "properties": {
        "title": {
          "type": "string",
          "fields": {
            "de": {
              "type":     "string",
              "analyzer": "german"
            },
            "fr": {
              "type":     "string",
              "analyzer": "french"
            }
          }
        },
		"description": {
          "type": "string",
          "fields": {
            "de": {
              "type":     "string",
              "analyzer": "german"
            },
            "fr": {
              "type":     "string",
              "analyzer": "french"
            }
          }
        }
      }
    }
  }
}

Obviously document level support will increase the number of types in the index but it is a cleaner way. Since my requirement is slightly different so I have to choose the field level. But all the examples in the field level gives me something like,

{
  "mappings": {
    "title": {
      "properties": {
        "de": {
          "fields": {
            "title": "string",
            "description": "string",
            "analyzer": "german"
          }
        },
        "fr": {
          "fields": {
            "title": "string",
            "description": "string",
            "analyzer": "french"
          }
        }
      }
    }
  }
}

I have to try it out but I have a feeling that it is not a supported way. If you have already tried this way please let me know or any thoughts are welcome.

Thanks,
-Shiv


Multiple language support : Object level analyzer mapping
(Shiv Naidu) #2

My mapping will not work but I am just proposing something like this would be nice. If somebody tried some other way to optimize . Thanks!


(system) #3