N-th order nesting where n>=3


(John Ohno) #1

Hi,
I have a mapping that looks a bit like this:

{ "foo" : {
"type" : "nested",
"properties" : {
"bar" : {
"type" : "nested",
"properties" : {
"baz" : {
"type" : "nested",
"properties" : {
"quux" : { "type" : "string" }
}
}
}
}
}
}
}

I want to perform a search that distinguishes between instances at the very
deepest levels of this hierarchy (i.e.: a foo can contain many bars which
contain many bazzes which contain many quuxen, but I wish to distinguish
between quux="hello" in the same baz as quux="goodbye" and quux="hello" in
the same bar as quux="goodbye").

A query like this gives me zero results, even when I know that it's
correctly formed:
{ "nested" : {
"path" : "foo",
"query" : {
"nested" : {
"path" : "bar",
"query" : {
"nested" : {
"path" : "baz",
"query" : {
"bool" : {
"must" : [
{ "term" : { "foo.bar.baz.quux" : "hello"} } ,
{ "term" : { "foo.bar.baz.quux" : "goodbye" } }
]
}
}
}
}
}
}
}}

If I specify intermediate paths in fully qualified terms (for instance,
{"nested": { "path" : "foo.bar.baz"}}), I get an error message claiming
that my fully qualified intermediate path does not refer to a nested object.

Everything I've seen on the web has referred to trivial 1- or 2-level
nesting. Is there some stupid conceptual mistake I'm making here?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/37490f04-8331-432b-9776-dbfab97116db%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #2