通配符查询中,要匹配的值可以是一个带有通配符的字符串,目前支持星号(*)和问号(?)两种通配符。要匹配的值中可以用星号(*)代表任意字符序列,或者用问号(?)代表任意单个字符,且支持以星号(*)或问号(?)开头。例如查询“table*e”,可以匹配到“tablestore”。
前提条件
参数
参数 | 描述 |
---|---|
query | 设置查询类型为WildcardQuery。 |
field_name | 列名称。 |
value | 带有通配符的字符串,字符串长度不能超过10字节。 |
table_name | 数据表名称。 |
index_name | 多元索引名称。 |
limit | 本次查询需要返回的最大数量。 |
get_total_count | 是否返回匹配的总行数,默认为False。
设置get_total_count为True后会影响查询性能。 |
ColumnsToGet | 是否返回所有列。
|
示例
query = WildcardQuery('k', 'key00*')
rows, next_token, total_count, is_all_succeed = client.search(
table_name, index_name,
SearchQuery(query, limit=100, get_total_count=True),
ColumnsToGet(return_type=ColumnReturnType.ALL)
)
在文档使用中是否遇到以下问题
更多建议
匿名提交