All Products
Search
Document Center

Tablestore:Term Query

Last Updated:May 07, 2026

A term query (TermQuery) finds data in a table by matching a specified value exactly, similar to string matching.

Usage notes

  • For non-text field types like Keyword and Integer, the field value must exactly match the query term.

  • Avoid using a term query on Text fields, as their tokenization is unpredictable and may change over time. A term query on a Text field checks if any token produced by the analyzer exactly matches the query term. The query term itself is not tokenized. To match an entire, un-tokenized value, use a virtual column to map the field to the Keyword type and then run the query. For example, if a Text field with the value "tablestore is cool" is tokenized into "tablestore", "is", and "cool", a query for "tablestore", "is", or "cool" will return a match.

Procedure

  1. Go to the Index Management tab.

    1. Log on to the Table Store console.

    2. In the top navigation bar, select a resource group and a region.

    3. On the Overview page, click the instance name or click Instance Management in the Actions column.

    4. On the Instance Details tab, in the Data Table List tab, click the data table name or click Index Management in the Actions column.

  2. On the Index Management tab, find the target Search Index and click Search in the Actions column.

  3. In the Search dialog box, configure the query.

    1. By default, all columns are returned. To return specific columns, turn off Retrieve All Columns and enter the column names, separated by commas.

      Note

      By default, Table Store returns the primary key columns of the data table.

    2. Select a logical operator: And, Or, or Not.

      If you select And, the query returns data that meets all specified conditions. If you select Or, the query returns data that meets at least one of the specified conditions. If you select Not, the query returns data that does not meet the specified conditions.

    3. Select an index field and click Add.

    4. Set the query type of the index field to Term Query (TermQuery) and enter the value to search for.

    5. By default, sorting is disabled. To sort the results by a specific field, turn on Enable Sorting, add the sort field, and configure the sort order.

    6. By default, aggregation is disabled. To perform statistical aggregation on a specific field, turn on Enable Aggregation, add the field for aggregation, and configure the aggregation settings.

  4. Click OK.

    The query results are displayed on the Index Management tab.

Development integration

You can use an SDK or a command-line tool to perform a term query.

Billing

Querying data by using a Search Index consumes read throughput. For more information, see Search Index metering and billing.

FAQ

Related documents