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

fix(search&aggregate):fix error overwrite and typo #3220 #3224

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

bitsark
Copy link

@bitsark bitsark commented Jan 9, 2025

* LOAD has NO AS param(https://redis.io/docs/latest/commands/ft.aggregate/)

* fix typo: WITHCOUT -> WITHCOUNT
@bitsark bitsark changed the title fix (#3220) fix error overwrite in search command #3220 Jan 10, 2025
@bitsark bitsark changed the title fix error overwrite in search command #3220 fix(search&aggregate):fix error overwrite and typo #3220 Jan 10, 2025
@bitsark
Copy link
Author

bitsark commented Jan 10, 2025

Fixes #3220

@ndyakov
Copy link
Collaborator

ndyakov commented Feb 4, 2025

@bitsark the RE build is falling, a test related to ft.aggregate states it expects an error, but got nil. Seems related, can you look at it?

@bitsark
Copy link
Author

bitsark commented Feb 6, 2025

@bitsark the RE build is falling, a test related to ft.aggregate states it expects an error, but got nil. Seems related, can you look at it?

sure, i will check the problem

@ndyakov
Copy link
Collaborator

ndyakov commented Feb 6, 2025

@bitsark I do see LOAD {field} AS {name} examples in https://github.com/RediSearch/RediSearch/blob/e155b7db40eeff5f29b47c6308810b2dda906c7c/docs/docs/indexing/_index.md?plain=1#L608 , and with a local test I can see the AS parameter working. Not sure if it is correctly implemented in the library, this is something we can add a test for ?

@bitsark
Copy link
Author

bitsark commented Feb 6, 2025

@bitsark I do see LOAD {field} AS {name} examples in https://github.com/RediSearch/RediSearch/blob/e155b7db40eeff5f29b47c6308810b2dda906c7c/docs/docs/indexing/_index.md?plain=1#L608 , and with a local test I can see the AS parameter working. Not sure if it is correctly implemented in the library, this is something we can add a test for ?

@ndyakov i will recheck this problem

@bitsark
Copy link
Author

bitsark commented Feb 6, 2025

@bitsark I do see LOAD {field} AS {name} examples in https://github.com/RediSearch/RediSearch/blob/e155b7db40eeff5f29b47c6308810b2dda906c7c/docs/docs/indexing/_index.md?plain=1#L608 , and with a local test I can see the AS parameter working. Not sure if it is correctly implemented in the library, this is something we can add a test for ?

@ndyakov the bug fixed in the pr is like:
FT.AGGREGATE itemIdx '*' LOAD 4 as aliasLoadName name $.price AS originalPrice
is not same as the example.

@ndyakov
Copy link
Collaborator

ndyakov commented Feb 6, 2025

@bitsark i can see the As field removed in the diff. I do think the calculation of the arguments look odd and is probably broken, but the As should be left since it is possible to have an alias for a loaded field, don't you think? Can you provide an example go code to reproduce the bug you are referring to?

@bitsark
Copy link
Author

bitsark commented Feb 6, 2025

@bitsark i can see the As field removed in the diff. I do think the calculation of the arguments look odd and is probably broken, but the As should be left since it is possible to have an alias for a loaded field, don't you think? Can you provide an example go code to reproduce the bug you are referring to?

@ndyakov , I reproduce the bug now. you are right. I misunderstood the bug. I will commit a new fix.

@ndyakov ndyakov self-assigned this Feb 7, 2025
@ndyakov ndyakov self-requested a review February 7, 2025 08:58
    * fixed the calculation bug of the count of load params
ndyakov
ndyakov previously approved these changes Feb 17, 2025
Copy link
Collaborator

@ndyakov ndyakov left a comment

Choose a reason for hiding this comment

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

@bitsark let's fix the tests. I would suggest trying to update the RE version instead of having such condition in the tests.

@ndyakov
Copy link
Collaborator

ndyakov commented Feb 18, 2025

@bitsark merged an update to fix the linter.

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 this pull request may close these issues.

3 participants