Search indexes in Tablestore SDK for Go support basic queries, Boolean query, sorting and paging, aggregation, full-text search, and k-nearest neighbor (KNN) vector query.
Basic queries
The following table lists the basic query types supported by search indexes.
|
Query type |
Description |
|
Matches all rows in a table. You can use this query to get the total row count or return random rows. |
|
|
Retrieves rows that exactly match a specified column value, similar to string matching. |
|
|
Retrieves rows whose column value matches at least one of the specified keywords, equivalent to the IN operator in SQL. |
|
|
Retrieves rows whose column value contains a specified prefix. |
|
|
Retrieves rows whose column value matches a string that contains wildcard characters. |
|
|
Retrieves rows whose column value falls within a specified range. |
|
|
Also called a NULL query or NULL-value query. Determines whether a specific column exists in a row, which is useful for sparse data. |
|
|
Collapses the result set based on a specific column so that only one row per distinct value is returned, ensuring diversity in the results. |
|
|
Geo queries include the following types:
|
|
|
Queries the child rows of nested fields. |
Boolean query
A Boolean query combines multiple subqueries and returns rows that match the specified conditions. For more information, see Boolean query.
Sorting and paging
You can predefine a sort method when you create a search index or specify one at query time. For large result sets, paginate by configuring the limit and offset parameters or by using tokens. For more information, see Sorting and paging.
Aggregation
Aggregation operations return statistics such as minimum, maximum, sum, average, count, distinct count, and percentiles. You can also group results by field value, range, geographical location, filter, histogram, or date histogram, perform nested queries, and query rows from aggregation results within each group. Multiple aggregations can be chained for complex analytics. For more information, see Aggregation.
Full-text search
Full-text search finds rows that contain specified query strings. You can configure highlight parameters to mark matched terms in the returned results. For more information, see Full-text search.
KNN vector query
KNN vector query performs approximate nearest neighbor searches to find the most similar items to a given vector in large-scale datasets. For more information, see KNN vector query.