Home / Companies / Elastic / Blog / Post Details
Content Deep Dive

BKD-backed geo_shapes in Elasticsearch: precision + efficiency + speed

Blog post from Elastic

Post Details
Company
Date Published
Author
Nick Knize
Word Count
1,847
Language
-
Hacker News Points
-
Summary

Elasticsearch has significantly enhanced its geo_shape field indexing technology by transitioning from the legacy prefix tree indexing to the new block k-d tree (BKD) technique, delivering improved performance and accuracy. This change, introduced in Elasticsearch 7.0, guarantees 1 cm accuracy and accelerates searching and indexing processes, addressing previous user challenges with spatial accuracy and performance configurations. Historically, spatial indexing relied on rasterization and quadtrees, which increased index sizes and complexity. The new approach maintains geometries in vector space, using triangular tessellation, which reduces the number of terms and preserves the original accuracy of geometries. This involves encoding triangles into a BKD data structure optimized for spatial searches. The BKD approach, utilizing selective indexing and a compact dimensional encoding for triangles, results in a more efficient index that is less than half the size of traditional methods, albeit with a minor spatial error of 1 cm. Future improvements and optimizations in BKD structures are planned, with ongoing benchmarks and community feedback encouraged to further refine the system.