Skip to content

Instantly share code, notes, and snippets.

View polyfractal's full-sized avatar

Zachary Tong polyfractal

View GitHub Profile
###Changes:
-Added "include_in_root" for each nested object.
-Removed the "nested" params from the last facet
This basically copies the nested doc into the root doc. You then reference the root "inner object" rather than the "nested object" to get the data. Be careful though, this breaks down if you have multiple nested docs that share the same name (e.g. array of nested), since the facet will operate on the entire array instead of individual ones.
See this thread for more info: https://groups.google.com/d/topic/elasticsearch/pjoNmosdCPs/discussion