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

Handle invalid date/time format #21

Open
thomax opened this issue Nov 22, 2012 · 1 comment
Open

Handle invalid date/time format #21

thomax opened this issue Nov 22, 2012 · 1 comment

Comments

@thomax
Copy link

thomax commented Nov 22, 2012

ES will throw a MapperParsingException and refuse to index a record if a field has strange formatting, e.g.:

"happens_on": ""

will fail. This goes for any field type, not just time/date stamps.

@simen
Copy link
Member

simen commented Nov 22, 2012

The exact reason is that ElasticSearch will guess the type of the field, and other records which have other types of data in the same field will raise this exception. E.g. if you first index this:

{count: 5}

and then later

{count: "Vlad Tepes"}

this will fail, because ElasticSearch thinks counts are integers, not people.

The only solution I can think of currently is to blank offending fields to nil and attempt to reindex so that at least the document gets updated somewhat. We might actually need to add a field to the indexed document to explain what has happened and aid in debugging. So that the evil count would end up something like this:

{count: null, indexing_errors: ["Blanked 'count' which was of a conficting type"]}

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