1

Is there a way to get around this when using RediSearch FT.SEARCH?

I basically want to get all the possible results for a search. I can page through them using the LIMIT offset count parameters but it errors out when I hit an offset higher than 10000.

cgipson
  • 378
  • 1
  • 16

2 Answers2

2

You can change that 10000 ceiling by setting the MAXSEARCHRESULTS property. You can set it on the module installation, see https://redis.io/docs/stack/search/configuring/ like:

loadmodule ./redisearch.so MAXSEARCHRESULTS 100000

or at runtime on the CLI or via your client like:

127.0.0.1:6379> FT.CONFIG GET MAXSEARCHRESULTS
1) 1) MAXSEARCHRESULTS
   2) 10000
127.0.0.1:6379> FT.CONFIG SET MAXSEARCHRESULTS 100000
OK
127.0.0.1:6379> FT.CONFIG GET MAXSEARCHRESULTS
1) 1) MAXSEARCHRESULTS
   2) 100000
127.0.0.1:6379>
BSB
  • 1,516
  • 13
  • 14
0

It appears that when using redis/redis-stack-server you are limited to the offset number. I stood up an enterprise redis instance on azure and was able to use the limit with an offset higher than 100000.

cgipson
  • 378
  • 1
  • 16
  • 1
    Any doc citing this 10000 limitation (i can't find it mentioned anywhere)? I tried to set the MAXSEARCHRESULTS variable like below but my container crashes and I get a segfault as soon as I try a search with a larger index. – Taylor Paul Nov 08 '22 at 18:41
  • @TaylorPaul it's probably not a limit as much as a sensible default on the non-enterprise image. I was able to use `FT.CONFIG SET MAXSEARCHRESULTS 2000000' (2M) on my local redis-stack container as answered by @BSB and it worked fine, so likely your crash was independent of redis and more about the actual container running out of memory. – mdisibio Mar 07 '23 at 21:49