Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why is auto-creating mappings flawed?


Because ElasticSearch just assigns index settings based on the first value it gets.

For trivial values such as numbers, that's usually okay, unless it happens that the field is polymorphic (not a good schema design, of course).

But it doesn't know how to set up any of the mappings; it doesn't know whether something is a full-text field (which often requires analyzers) or an atomic, enum-type string.

It also doesn't know about dates. If you index pure JSON documents, it will simply store them as strings.

This would all have been a non-problem if updating mappings in ES were simple, but it's not. A mapping is generally append-only; if you want change the type of a mapping, or its analyzer, or most other settings, you have to create a new index and repopulate it. Schema migrations in ES are a lot more painful than, say, PostgreSQL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: