if you have an array of objects, eg:
{
followers: [{ user: 1, name "john"}, { user: 2, name: "mary" }
}
then these get indexed as something like this:
{
"followers.user": [1,2],
"followers.name": ["john", "mary"]
}
But those arrays are actually multi-value fields, which have no intrinsic
order. they're just "bags" of values. You lose the correlation between
"user" and "name".
If you set "followers" to be type "nested" instead, then each object is
indexed as a separate (but externally invisible) document, and so you
retain the correlation between user and name. And you have to use nested
queries/filters to access those values. They are not visible in the parent
doc.
Sometimes, eg for faceting, you want those values to be visible in the
parent. In this case, set include_in_parent to true. This will index each
nested doc as a separate doc AND index the values into the parent doc (as
per my example above).
if you have nested objects within nested objects, then the parent of the
nested>nested is not the top-level document. In this case, use
include_in_root instead.
clint
On 22 May 2013 10:23, Chetana ambha.career@gmail.com wrote:
I am not clear on the usage of include-in-all and include-in-root. Could
someone please explain with some examples or point to some good references
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.