Conditional mapping. if


(김진욱) #1

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?


(Benjamin) #2

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


(system) #3

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