Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapper_parsing_exception - failed to parse #579

Closed
K-7 opened this issue May 5, 2017 · 6 comments
Closed

mapper_parsing_exception - failed to parse #579

K-7 opened this issue May 5, 2017 · 6 comments

Comments

@K-7
Copy link

K-7 commented May 5, 2017

I know this happening because there is a field whose data type is different from the actual kind of data that is coming. But I have used dynamic mapping wherein I don't specify the mapping and allow the elastic to map itself. The problem that I am facing is, few days back a field called create_date was of date type but now since I do a Json.dump it has become of type string and there is a conflict because of this.
Every day a new index gets created and corresponding new mapping has to get created for it. Then why does this conflict happen? can't we have different mappings for different indices? and how can i resolve this conflict and make sure that the elastic picks up the current datatype and ignores the conflicts

@honzakral
Copy link
Contributor

Once a mapping is created it cannot be changed so dynamic mapping won't help you here You have to specify the mappings manually or use index templates to define them implicitly for a set of indices.

Hope this helps,
Honza

@K-7
Copy link
Author

K-7 commented May 5, 2017

But the problem I have is I can't specify the mapping while an index gets created. That is because the content is a dynamic JSON whose fields are not predefined. Kindly suggest me an approach where in I am able to allow dynamic mapping and whenever the data type of a field changes the elastic considers the latest datatype

@honzakral
Copy link
Contributor

Elasticsearch cannot change a datatype of an existing field, due to its nature it is impossible.

If you need to control the mappings of newly created indices, without creating them explicitly before indexing, please have a look at index templates - https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html

@K-7
Copy link
Author

K-7 commented May 5, 2017

Ok I get that. But how do I clean up the existing conflicts that have already occured ?

@honzakral
Copy link
Contributor

You have to delete the indices and create new ones with proper mappings.

@K-7
Copy link
Author

K-7 commented May 5, 2017

Ok Thank you Honza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants