All Products
Search
Document Center

Tablestore:RangeQuery

Last Updated:May 09, 2024

RangeQuery specifies the configurations of a range query. You can use the range query feature to query data that falls within the specified range. If the type of a field is TEXT, Tablestore tokenizes the string and matches any of the tokens that fall within the specified range.

Data structure

message RangeQuery {
    optional string field_name = 1;
    optional bytes range_from = 2; // variant value
    optional bytes range_to = 3; // variant value
    optional bool include_lower = 4;
    optional bool include_upper = 5;
}

Parameter

Type

Required

Description

field_name

string

Yes

The name of the attribute column.

range_from

bytes

Yes

The value from which the query starts. The value must be encoded by using PlainBuffer. For more information, see PlainBuffer.

When you specify range conditions, you can use greaterThan to specify the greater than (>) sign and greaterThanOrEqual to indicate the greater than or equal to (≥) sign.

range_to

bytes

Yes

The value at which the query ends. The value must be encoded by using PlainBuffer. For more information, see PlainBuffer.

When you specify range conditions, you can use lessThan to specify the less than (<) sign and lessThanOrEqual to indicate the less than or equal to (≤) sign.

include_lower

bool

No

Specifies whether to include range_from in the results.

include_upper

bool

No

Specifies whether to include range_to in the results.