Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rockyburt/af6d428d1ea176b922bbc7439c591243 to your computer and use it in GitHub Desktop.
Save rockyburt/af6d428d1ea176b922bbc7439c591243 to your computer and use it in GitHub Desktop.

The problem is doing either FT.SEARCH or FT.AGGREGATE command on an index that contains 15999 documents and asking for an offset beyond 10000.

redis-cli output...

127.0.0.1:6380> FT.AGGREGATE rentals:default:idx:rentallisting:default @type:{_invalid|condo|apartment|bachelor|basement|studio|duplex|loft|house|town_house|multi_unit|cabin|cottage|room|private_room|shared_room} LOAD 1 @__key APPLY "@highlight_status_value * 100" AS rank SORTBY 4 @rank DESC @modified DESC LIMIT 9999 1

1) (integer) 15599
2) 1) "__key"
   2) "rentals:default:doc:rentallisting:item:cmVudGFsbGlzdGluZzo1NjExNDY="
   3) "highlight_status_value"
   4) "0"
   5) "rank"
   6) "0"
   7) "modified"
   8) "1649256837.94"
127.0.0.1:6380> FT.AGGREGATE rentals:default:idx:rentallisting:default @type:{_invalid|condo|apartment|bachelor|basement|studio|duplex|loft|house|town_house|multi_unit|cabin|cottage|room|private_room|shared_room} LOAD 1 @__key APPLY "@highlight_status_value * 100" AS rank SORTBY 4 @rank DESC @modified DESC LIMIT 10000 1
1) (integer) 15599
127.0.0.1:6380> FT.AGGREGATE rentals:default:idx:rentallisting:default @type:{_invalid|condo|apartment|bachelor|basement|studio|duplex|loft|house|town_house|multi_unit|cabin|cottage|room|private_room|shared_room} LOAD 1 @__key APPLY "@highlight_status_value * 100" AS rank SORTBY 4 @rank DESC @modified DESC LIMIT 10001 1
(error) OFFSET exceeds maximum of 10000
127.0.0.1:6380>

Using docker image: docker.io/redis/redis-stack-server:6.2.0-v1

# Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=8, just started
* <search> RediSearch version 2.2.10 (Git=HEAD-3d0701f6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment