小编use*_*990的帖子

对于多个字段索引,Redissearch 前缀搜索始终返回最大 200

使用 python RediSearch 客户端连接到 RediSearch 并执行应该匹配 300 个文档的前缀搜索,如果索引中有另一个 TagField,它只会返回 200:

from redisearch import Client, Query, TextField, TagField

client = Client('myindex')
client.create_index([TextField('username'), TagField('age')])

# add 300 documents
for i in range(300):
    client.add_document(i, username='user%s' % i, age=i)

res = client.search(Query("@username:user*"))

assert res.total == 300 # this is always 200 no matter how many documents you add.

Run Code Online (Sandbox Code Playgroud)

python redis redisearch

2
推荐指数
1
解决办法
340
查看次数

标签 统计

python ×1

redis ×1

redisearch ×1