redis-om-python icon indicating copy to clipboard operation
redis-om-python copied to clipboard

FindQuery.page does execute

Open doc-hex opened this issue 3 years ago • 3 comments

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

doc-hex avatar Dec 21 '22 19:12 doc-hex

Bigger problem:

  • from page() FindQuery.execute is called w/ exhaust_results default of True
  • even if I ask for .page(offset=10, limit=10) it starts recursing and fetching other data??
  • hits OFFSET exceeds maximum of 10000 after just 10 rounds??
  • because it's adding strings together as numbers?
  • from monitor output:
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"

doc-hex avatar Dec 27 '22 17:12 doc-hex

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 avatar Apr 12 '23 10:04 mancioshell

@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)

mancioshell avatar Apr 12 '23 11:04 mancioshell