Conditional mapping. if

I want to use the analyzer differently depending on the value of another field in single field.

As the code below

"mappings": {
    "sample_type": {
        "properties":{
            "my_text": {
                "if=language:en-US"{
                      "type": "text",
                      "analyzer": "English"
                 },
                "else"{
                      "type": "text",
                      "analyzer": "Spanish"
                 }
            },
            "_default_": {
                "type": "keyword"
            }
        }
    }
}

What should I do?

This kind of logic you can put in your business logic when you create JSON-request.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.