admin管理员组

文章数量:1131469

I am trying to create a search query with redis and filter based on the id of the document. It seems we need to use the INKEYS command, but it doesn't work for the key ru203:book:details:9780002005883 even after escaping the :.

The command "FT.SEARCH" "books-idx" "@author_ids:{1 | 2} INKEYS 1 ru203\\:book\\:details\\:9780002005883" "NOCONTENT" "LIMIT" "0" "10000" doesn't return anything. Am I using the command correctly?

(without the INKEYS part, 2 documents are returned)

Edit: the method in redis-py is Query.limit_ids

I am trying to create a search query with redis and filter based on the id of the document. It seems we need to use the INKEYS command, but it doesn't work for the key ru203:book:details:9780002005883 even after escaping the :.

The command "FT.SEARCH" "books-idx" "@author_ids:{1 | 2} INKEYS 1 ru203\\:book\\:details\\:9780002005883" "NOCONTENT" "LIMIT" "0" "10000" doesn't return anything. Am I using the command correctly?

(without the INKEYS part, 2 documents are returned)

Edit: the method in redis-py is Query.limit_ids

Share Improve this question edited Jan 8 at 18:14 BPDev asked Jan 8 at 4:41 BPDevBPDev 8675 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Redis Insight interprets all inserted characters as part of the query, including optional arguments such as INKEYS or LIMIT. To use optional arguments, you can try Workbench. It also offers syntax auto-completion for Redis Query Engine.

本文标签: redisHow to use INKEYS to filter by the keydocumentidStack Overflow