Skip to content

fix(search): align ft.search with server #2988

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

nkaradzhov
Copy link
Collaborator

as per the ft.search docs ( https://redis.io/docs/latest/commands/ft.search ):

If a relevant key expires while a query is running,
an attempt to load the key's value will return a null array.
However, the key is still counted in the total number of results.

So, instead of crashing when seeing a null as a value, we return empty object.

fixes #2772
see #2814

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

as per the ft.search docs ( https://redis.io/docs/latest/commands/ft.search ):

    If a relevant key expires while a query is running,
    an attempt to load the key's value will return a null array.
    However, the key is still counted in the total number of results.

So, instead of crashing when seeing a null as a value, we
return empty object.

fixes redis#2772
see redis#2814
Copy link
Member

@bobymicroby bobymicroby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nkaradzhov nkaradzhov merged commit 2bb515e into redis:master Jun 5, 2025
11 checks passed
@nkaradzhov nkaradzhov deleted the align-ftsearch-with-server branch June 5, 2025 08:47
florian-schunk pushed a commit to florian-schunk/node-redis that referenced this pull request Jun 18, 2025
as per the ft.search docs ( https://redis.io/docs/latest/commands/ft.search ):

    If a relevant key expires while a query is running,
    an attempt to load the key's value will return a null array.
    However, the key is still counted in the total number of results.

So, instead of crashing when seeing a null as a value, we
return empty object.

fixes redis#2772
see redis#2814
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FT.SEARCH: Cannot read properties of undefined (reading 'length')
2 participants