All Products
Search
Document Center

Tablestore:NestedQuery

Last Updated:Feb 06, 2025

NestedQuery specifies the configurations of a nested query. You can use the nested query feature to query the data in the child rows of Nested fields. Nested fields cannot be directly queried. To query a Nested field, you must specify the path of the Nested field and a subquery in a NestedQuery object. The subquery can be a query of any type.

Data structure

message NestedQuery {
    optional string path = 1;
    optional Query query = 2;
    optional ScoreMode score_mode = 3;
    optional float weight = 4;
    optional InnerHits inner_hits = 5;
}

Parameter

Type

Required

Description

path

string

Yes

The path of the Nested field. The path is similar to the tree structure. For example, news.title indicates the title subfield in the Nested field named news.

query

Query

Yes

The query that you want to perform on the subfield in the Nested field. The query can be of any query type.

score_mode

SortMode

No

The value that is used to calculate the score when a field contains multiple values.

weight

float

No

The weight configurations of the query condition.

inner_hits

InnerHits

No

The settings of the subfields of the Nested field.