Query for nested objects count


(Paulo Correa) #1

Hi,

I have a need to retrieve documents (of type "bucket") which have at least
2 nested objects (of type "products") inside them (details of my mapping
and documents are on the gist below).

As far as I've searched, I did not find a way to accomplish this on a
Elasticsearch (unless perhaps if I'd used parent/child for bucket/products,
and used a "has child query" with "min_children=2"), but I'd rather avoid
changing my mapping if I can.

Does anybody know if it is possible?

PS: not really the same situation, but perhaps *option number 2 *from
this answer would be a solution
http://stackoverflow.com/questions/19609498/elastic-search-order-by-count-of-nested-object.
Does anybody see another alternative?

Thanks!

--
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/9e3beb3b-7df0-432c-a32e-3317856d4080%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2