Hello. I am new to EalsticSearch and really loving it. I have a lot of the basic queries working, but I am having difficulty figuring out how to use a facet as a sub query. Any guidance or even a link to a good piece of documentation that I missed would be very welcomed.
Here is an example:
I am indexing Folders and Files. Each can have "type" (folder or file), "name", and "description". If it is a folder, it can have "children" which themselves would be folders or files.
So, I can do a facet query to count up all of the children:
And the results will contain:
* terms: [
That is all fine and dandy. But here is what I am trying to do: I want to be able to say something like "Give me all the folders with 'blue' in the name and count all of the children for EACH folder".
The result set that I would love to have would then have like 5 folders listed and for each hit, it would give a separate count of children. (for now, ignore children folders have children of their own)
So, is this possible? If so, please shed some light for me. Thank you!