3
votes

I am new to Elasticsearch. I have tried different solution provided on Stack Overflow and other websites but they didn't work for me that's why I am posting this question.

I am trying to add tokenizer": "uax_url_email" so that I can easily search email with query.

But when I am setting the mapping it Elastic Search is giving me this error:

Root mapping definition has unsupported parameters (mapper_parsing_exception)

I have tried to delete the index and recreate it but it also didn't help.

My mapping link.

http://localhost:9200/users/user/_mapping

{
"settings": {
            "analysis": {
                "analyzer": {
                    "urls-links-emails": {
                        "type": "custom",
                        "tokenizer": "uax_url_email"
                    }
                }
            }
        },
        "mappings":{
            "user": {
                "properties": {
                    "id" : {"type": "long"},
                    "first_name" : {"type": "text"},
                    "middle_name" : {"type": "text"},
                    "last_name" : {"type": "text"},
                    "full_name" : {"type": "text"},
                    "image" : {"type": "text"},
                    "email" : {"type": "text", "analyzer": "urls-links-emails"},
                    "mobile_number" : {"type": "text"},
                    "profile_image" : {"type": "text"},
                    "thumbnail" : {"type": "text"},
                    "role" : {"type": "text"},
                    "role_id" : {"type": "byte"},
                    "joined_date" : {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"},
                    "updated_date" : {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"}
                }
            }
        }
    }
1
I tested your JSON with a PUT request to localhost:9200/test1 and it works (version 5.5.1).MartinSchulze
thanks for the reply @MartinSchulze but it is still not working for me :(. My elastic search version is also 5.5shery089
Please show the request. Do you have the right address? It has to be a PUT request to localhost:9200/usersMartinSchulze
Yes @MartinSchulze Its a PUT request to localhost:9200/users/user/_mapping and the body is {"setting" ... same as above} and shows the errorshery089
I have removed some of the fields because of less char in comment { "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [settings : {analysis={analyzer={urls-links-emails={type=custom, tokenizer=uax_url_email}}}}] [mappings : {user={properties={ email={type=text, analyzer=urls-links-emails}, mobile_number={type=text} , joined_date={type=date, format=yyyy-MM-dd HH:mm:ss}, updated_date={type=date, format=yyyy-MM-dd HH:mm:ss}}}}]" } ],shery089

1 Answers

1
votes

(Posted on behalf of a commenter).

Please use http://localhost:9200/users, then it will work.