Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query returns all results after hitting limit #623

Closed
mmiazzo opened this issue May 15, 2024 · 3 comments · Fixed by #624
Closed

Query returns all results after hitting limit #623

mmiazzo opened this issue May 15, 2024 · 3 comments · Fixed by #624

Comments

@mmiazzo
Copy link

mmiazzo commented May 15, 2024

Running a page query returns all results:
Redis config:
FT.CONFIG SET MAXSEARCHRESULTS -1

class TemplateGray(JSONModel):
    idd: str = Field(primary_key=True)
    version: str
    obj_id: str
    gray: pickled

@classmethod
def get_gray_page(cls):
    return TemplateGray.find().page(limit=1000)

print(len(TemplateGray.get_gray_page()))
> 157995

I would expect the length of this to be 1000, not every single record under the schema

@slorello89
Copy link
Member

Hi @mmiazzo - what version of RediSearch and redis om python are you using? Are you able to see the FT.SEARCH command that Redis OM is sending to your Redis instance using the Monitor? I am unable to reproduce this issue.

@slorello89
Copy link
Member

Nevermind @mmiazzo - I see it, for some reason it's automatically paginating over the entire result set even when just page is called, need to dig a bit.

@mmiazzo
Copy link
Author

mmiazzo commented May 15, 2024

Hi @slorello89

I am using redis-om 0.3.0 with redis-stack:latest docker image. from INFO STATS:

redis_version:7.2.4
# Modules
module:name=search,ver=20813,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors]
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
module:name=ReJSON,ver=20610,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors]
module:name=timeseries,ver=11012,api=1,filters=0,usedby=[],using=[],options=[]
module:name=redisgears_2,ver=20020,api=1,filters=0,usedby=[],using=[],options=[]
module:name=bf,ver=20612,api=1,filters=0,usedby=[],using=[],options=[]

As you said I was seeing the empty query but paginating over the entire result set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants