Searching through a document not knowing the path

I want to search through a document and get data for Steven and all his children (so in this example James). Is there a way to do it not knowing the path for Steven - so it should be children.children.name - but what if I don't know on which level Steven occurs? Is it even possible in Elasticsearch?

{
    name: "John",
    a: 1,
    b: 2,
    children:
        [
            {
                name: Mark,
                a: 3,
                b: 5,
                children:
                    [
                        {
                            name: "Steven",
                            a: 2,
                            b: 5,
                            children: [{ name: "James", a: 1, b: 5 }],
                        },
                    ],
            },
            { name: "David", a: 3, b: 5 }
        ],
}

What is the data type of your field: is it nested or object ?

We're just working on design, but were planning to make it nested.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.