Analyzer [default_analyzer] not found for field [stateNames]

I am trying to copy data from my old elastic to a new elastic. So, I was copy the mapping and setting of the index.

{"mappings":{"profile":{"properties":{"Address":{"type":"text","analyzer":"default_analyzer"},"CandidateGuid":{"type":"keyword"},"CandidateId":{"type":"integer"},"City":{"type":"text","analyzer":"default_analyzer"},"ClientCanId":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Country":{"type":"text","analyzer":"default_analyzer"},"CreatedById":{"type":"long"},"CreatedDate":{"type":"date"},"CurrentCompany":{"type":"text","analyzer":"default_analyzer"},"Email":{"type":"text","analyzer":"url_email_analyzer"},"FirstName":{"type":"text","analyzer":"default_analyzer"},"IndexedDate":{"type":"date"},"IsIndexed":{"type":"long"},"IsParsed":{"type":"long"},"LastName":{"type":"text","analyzer":"default_analyzer"},"LastUpdate":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"LastUpdated":{"type":"date"},"LastUpdatedDate":{"type":"date"},"Location":{"type":"text","analyzer":"default_analyzer"},"LocationAccuracy":{"type":"short"},"Mobile":{"type":"text","analyzer":"default_analyzer"},"ModifiedDate":{"type":"date"},"OrgId":{"type":"integer"},"Parsed":{"properties":{"Company":{"type":"text","analyzer":"default_analyzer"},"Country":{"type":"text","analyzer":"default_analyzer"},"Educations":{"properties":{"Degree":{"type":"text","analyzer":"default_analyzer"},"From":{"type":"date"},"To":{"type":"date"},"University":{"type":"text","analyzer":"default_analyzer"}}},"Emails":{"type":"text","analyzer":"url_email_analyzer"},"Experiences":{"properties":{"Company":{"type":"text","analyzer":"default_analyzer"},"From":{"type":"date"},"Location":{"type":"text","analyzer":"default_analyzer"},"Summary":{"type":"text","analyzer":"default_analyzer"},"Title":{"type":"text","analyzer":"default_analyzer"},"To":{"type":"date"}}},"FirstName":{"type":"text","analyzer":"default_analyzer"},"FullName":{"type":"text","analyzer":"default_analyzer"},"Guid":{"type":"keyword"},"HighestDegree":{"type":"text","analyzer":"default_analyzer"},"Industry":{"type":"text","analyzer":"default_analyzer"},"LastName":{"type":"text","analyzer":"default_analyzer"},"Location":{"type":"text","analyzer":"default_analyzer"},"Name":{"type":"text","analyzer":"default_analyzer"},"Phones":{"type":"text","analyzer":"default_analyzer"},"PostalCode":{"type":"text","analyzer":"default_analyzer"},"RecentExperience":{"type":"text","analyzer":"default_analyzer"},"Skills":{"type":"text","analyzer":"default_analyzer"},"Title":{"type":"text","analyzer":"default_analyzer"},"YearsOfExperience":{"type":"short"},"cities":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"coordinates":{"properties":{"lat":{"type":"float"},"lon":{"type":"float"}}},"countries":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"stateNames":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"states":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"Phone":{"type":"text","analyzer":"default_analyzer"},"Qualification":{"type":"text","analyzer":"default_analyzer"},"ResumeName":{"type":"keyword"},"ResumeText":{"type":"text","analyzer":"special_char_analyzer"},"State":{"type":"text","analyzer":"default_analyzer"},"Title":{"type":"text","analyzer":"special_char_analyzer"},"TotalExperience":{"type":"short"},"ZipCode":{"type":"text","analyzer":"default_analyzer"},"Zipcode":{"type":"text","analyzer":"default_analyzer"},"cities":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"default_analyzer"},"coordinates":{"type":"geo_point"},"countries":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"default_analyzer"},"locationAccuracy":{"type":"short"},"stateNames":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"default_analyzer"},"states":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"default_analyzer"},"zips":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"default_analyzer"}}}}}

when I tried to PUT on //localhost:9200/profiles through a postman call, I am getting error as

{
"error": {
    "root_cause": [
        {
            "type": "mapper_parsing_exception",
            "reason": "analyzer [default_analyzer] not found for field [stateNames]"
        }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping [profile]: analyzer [default_analyzer] not found for field [stateNames]",
    "caused_by": {
        "type": "mapper_parsing_exception",
        "reason": "analyzer [default_analyzer] not found for field [stateNames]"
    }
},
"status": 400
}

when I was checking with the error, mostly there are issue with the json file. but I just copied it from the older elastic. The versions of old and newer elastic are same and its 5.3.3.
what could be the possible wrong.?

Welcome!

Analyzers are defined in the index settings. You just copied the mapping where you need as well to copy index settings.

BTW please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

so should i copy settings first and then mappings ?

You can copy all together and just send settings and mapping when you create the index.

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