Company
Date Published
Author
Coralogix Team
Word count
3127
Language
English
Hacker News points
None

Summary

The article explores the Elasticsearch flattened datatype, designed to handle documents with numerous or unpredictable fields efficiently, addressing common issues like 'mapping explosions' that degrade performance. Unlike traditional mapping methods which can lead to excessive field growth and memory issues, the flattened datatype indexes an entire JSON object as a single keyword field, reducing the total field count but limiting query capabilities. It contrasts with other methods like nested datatypes, which can complicate performance and visibility, and disabling fields, which restricts querying. The flattened datatype avoids re-indexing challenges associated with dynamic and explicit mappings by treating multiple nested fields as a single entity, reducing cluster state update burdens. However, it presents limitations in query types and capabilities, making it suitable for scenarios that do not require extensive querying or numerical data aggregation.