Document relations with ElasticSearch
summary
ElasticSearch exposes two concrete relation models with tradeoffs: parent-child routed by parent ID keeps parent and children on the same shard so queries run a local in‑memory join (index children before parent is allowed, the in‑memory structure size drops in 0.9.1); nested uses block indexing so each nested object becomes a Lucene doc enabling precise matches like chapter title = "Introduction" AND pages < 15 and score modes (sum/avg/max) control parent scoring. Many‑to‑many still forces denormalization and warmer API lets you preload relation data.
AI-written summary · about
