New

The executive guide to generative AI

Read more
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

Nested Query

edit

See Nested Query

QueryBuilder qb = nestedQuery(
        "obj1",               
        boolQuery()           
                .must(matchQuery("obj1.name", "blue"))
                .must(rangeQuery("obj1.count").gt(5))
    )
    .scoreMode("avg");        

path to nested document

your query. Any fields referenced inside the query must use the complete path (fully qualified).

score mode could be max, total, avg (default) or none

Was this helpful?
Feedback