Query Syntax: How to build a multi-field combined query that supports nested documents?

I am looking for a query syntax that lets me do following search

WHERE
(
reference MATCH '<match_query>' OR
order.number MATCH '<match_query>' OR
order.items.comments MATCH '<match_query>' OR
)
AND
(
reference MATCH_WILDCARD '<wildcard_query>' OR
order.number MATCH_WILDCARD '<wildcard_query>' OR
order.items.comments MATCH_WILDCARD '<wildcard_query>' OR
)
AND
(
reference NOT_MATCH '<not_match_query>' OR
order.number NOT_MATCH '<not_match_query>' OR
order.items.comments NOT_MATCH '<not_match_query>' OR
)

If I understand ES syntax correctly - I have to use "should" combination for each of the "OR" condition and set minimum_should_match to "1".

But I do not see how to combine multiple "bool\should" queries under single "must" parent?

Any ideas?

Thank you!

Alex

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