Return documents that nested object count greather than zero

Hi ,
Please let me know ,how to return documents that nested object count is greater than zero.
i want first filter nested object then return documents that have nested object number greather than zero.

products:[
{ id=1 ,number="01" ,name="iphone" ,prices:[{Enabled = true ,price = 1} ,{Enabled = false,price = 2}] } ,

{ id=2 ,number="02" ,name="samsung" ,prices:[{Enabled = false ,price = 10} ,{Enabled = false,price = 20}]  },
]

for "products" document must be return products that have at least one "Enabled" prices.
result must be:
{ id=1 ,number="01" ,name="iphone" ,prices:[{Enabled = true ,price = 1}] }

Use a nested query with a term query in it which checks for enabled = true.

(I consider that you indexed individual products which is unclear here)

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