redis / redis-om-python

Object mapping, and more, for Redis and Python
MIT License
1.09k stars 108 forks source link

FindQuery.page does execute #443

Open doc-hex opened 1 year ago

doc-hex commented 1 year ago

I just want to set the offset/limit .. maybe I don't want to execute yet.

doc-hex commented 1 year ago

Bigger problem:

1672160137.056757 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "1010" "10" "SORTBY" "created_at" "desc"
1672160137.063263 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "2010" "10" "SORTBY" "created_at" "desc"
1672160137.071339 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "3010" "10" "SORTBY" "created_at" "desc"
1672160137.082164 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "4010" "10" "SORTBY" "created_at" "desc"
1672160137.093802 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "5010" "10" "SORTBY" "created_at" "desc"
1672160137.107636 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "6010" "10" "SORTBY" "created_at" "desc"
1672160137.121365 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "7010" "10" "SORTBY" "created_at" "desc"
1672160137.135966 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "8010" "10" "SORTBY" "created_at" "desc"
1672160137.150128 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "9010" "10" "SORTBY" "created_at" "desc"
1672160137.150758 [0 127.0.0.1:52172] "ft.search" ":models.EXAMPLE:index" "*" "LIMIT" "10010" "10" "SORTBY" "created_at" "desc"
mancioshell commented 1 year ago

Same here. If i tried to call .page with limit = 50, i received an error the same error:

OFFSET exceeds maximum of 10

Is the library maintained yet?

mancioshell commented 1 year ago

@doc-hex i have been resolved this issue with a workaround:

.copy(offset=start_index, limit=limit).execute(exhaust_results=False)

instead of:

.page(offset=start_index, limit=limit)