Company
Date Published
Author
Gilad Gal
Word count
2636
Language
-
Hacker News points
None

Summary

Elasticsearch has introduced runtime fields, a schema-on-read capability that complements its traditional schema-on-write approach, providing flexibility in altering document schemas post-ingestion and generating fields for search queries. Runtime fields, which are evaluated at query time, do not increase index size and can reduce storage costs and ingestion speed, but they may lead to expensive queries and decreased search speed. These fields can be defined in index mappings or queries and are useful for fixing errors in indexed data by overriding values temporarily. Runtime fields allow experimentation with data structures without impacting resource consumption, and users can eventually convert useful runtime fields into indexed fields for better performance. This approach supports dynamic mapping, reducing the risk of mapping explosions by creating new fields as runtime fields initially, and later indexing them if beneficial. Elasticsearch recommends using runtime fields alongside indexed fields to balance performance and flexibility, and encourages users to explore this feature by upgrading to version 7.11 or using the Elasticsearch Service.