There is a way to use multiple analyzers?

Hi everyone, I'm starting my way to learn and use elasticsearch alongside the "MEN" stack. And I was wondering if there is a way to use multiple parsers, I show you the section of code that I want to use:

query = {
    "bool": {
        "must": [
            {
                "multi_match": {
                    "query": strQuery + "~",
                    "fields": ["strDescription^10", "strCategory^30", "strSubCategory^40", "strVendorPart"],
                    "minimum_should_match": "95%",
                    // This part is where I want to add another parser
                    "analyzer" : "elastic_synonym_analyzer"
                }
            }
        ],
    }
};

The index I'm working with is the following:

{
    "settings" : {
        "analysis" : {
            "analyzer" : {
                "standard_asciifolding": {
                    "tokenizer": "standard",
                    "filter": [ "my_ascii_folding" ]
                },
                "elastic_synonym_analyzer" : {
                    "tokenizer" : "standard",
                    "filter" : [
                        "my_synonym"
                    ]
                }
            },
            "filter" : {
                "my_synonym" : {
                    "type" : "synonym",
                    "synonyms" : []
                },
                "my_ascii_folding": {
                    "type": "asciifolding",
                    "preserve_original": true
                }
            }
        }
    }
}

I hope you can help me.

P.S. The version I am using of elasticsearch is 6.2.4 (I know it should increase but first I want to know how to solve this problem)

You should create new sub fields for the same existing fields which are using another analyzer.

See

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