elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', '[match] analyzer [name_phonetic] not found')

Mapping example-

    spouseNameQuery = {
        "match": {
            "Spouse_Name": {
                # "query": input_dict['Spouse_Name'],
                "query": val,
                "analyzer": "name_phonetic",
                "prefix_length": 1,
                "minimum_should_match": "100%"
            }
        }
    }


    body = {"query": {"bool": Dict_all}, "highlight": {
        "fields": {
            "Home_Address": {}, "Email_Id": {}, "Mobile_No": {}, "BankAcDetails": {}
        }
    }}
    print("The elastic query is:-\n", body)
    res = client.search(index=_index,body=body, size=2000, request_timeout=30)

Welcome!

Where/how did you define this name_phonetic analyzer?

yes i have defined it in the schema/mapping like this:

"analyzer": {
            
                        "name_phonetic": {
                            "filter": [
                                "icu_normalizer",
                                "icu_folding",
                                "punct_white",
                                "phonetic",
                                "lowercase",
                                "trim"
                            ],
                            "tokenizer": "standard"
                        },

I think that you are running the query against an index which does not have this analyzer.

If you still can't fix the problem, could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

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