Skip to content

Add FT.ALTER in OM JSON and Hash repo#645

Merged
rueian merged 5 commits intoredis:mainfrom
imvtsl:issue-632
Oct 25, 2024
Merged

Add FT.ALTER in OM JSON and Hash repo#645
rueian merged 5 commits intoredis:mainfrom
imvtsl:issue-632

Conversation

@imvtsl
Copy link
Copy Markdown
Contributor

@imvtsl imvtsl commented Oct 10, 2024

Signed-off-by: Vatsal [email protected]

Closes #632.

@rueian
Copy link
Copy Markdown
Collaborator

rueian commented Oct 24, 2024

Hi @imvtsl, are you still working on testing?

@imvtsl
Copy link
Copy Markdown
Contributor Author

imvtsl commented Oct 24, 2024

Hey @rueian
I took a pause after seeing the discussion on the issue. I was just about to ping you regarding this PR, but you beat me to it!

Before I dive back in, I wanted to clarify—are we still good with the solution developed in this PR?
Does this impact this PR in any way? Apologies if it's a basic question, I am new to this repository and Redis.

@rueian
Copy link
Copy Markdown
Collaborator

rueian commented Oct 24, 2024

The discussion doesn’t affect this PR. FT.ALTER itself is still a useful feature.

@imvtsl
Copy link
Copy Markdown
Contributor Author

imvtsl commented Oct 24, 2024

Thank you for clarification. I will resume right away!

@imvtsl
Copy link
Copy Markdown
Contributor Author

imvtsl commented Oct 25, 2024

Hi @rueian
I have added tests in hash_test and json_test for this feature and have verifed the coverage using dockertest.sh.

Is there any style guide that we reference? If yes, can you share that so I can look it up make any required changes before I update this PR from Draft to Ready for Review.

@imvtsl
Copy link
Copy Markdown
Contributor Author

imvtsl commented Oct 25, 2024

Also, I noticed an issue.

alter.Schema().Add().Field("$.Nested.F1").Options("TEXT").Build() works as in the test case, however
alter.Schema().Add().Field("$.Nested.F1").Options("TEXT SORTABLE").Build() fails with json_test.go:245: Invalid field type for field '$.Nested.F1\'. error.
I verified that it's valid command in cli, and this code change is correctly building up the command slice. Am I missing something here?

command slice cli

@rueian
Copy link
Copy Markdown
Collaborator

rueian commented Oct 25, 2024

Is there any style guide that we reference? If yes, can you share that so I can look it up make any required changes before I update this PR from Draft to Ready for Review.

The tests are already looked good to me.

alter.Schema().Add().Field("$.Nested.F1").Options("TEXT SORTABLE").Build() fails with json_test.go:245: Invalid field type for field '$.Nested.F1\'. error.

I think that was a bug caused by the wrong command definitions. The options should be marked as "multiple": true:

{
"name": "options",
"type": "string"
}

I think we can have another PR to fix that.

@imvtsl imvtsl marked this pull request as ready for review October 25, 2024 20:31
@imvtsl
Copy link
Copy Markdown
Contributor Author

imvtsl commented Oct 25, 2024

Thanks, I marked it as ready for review. I don't see the option to request review. @rueian can you review this PR?

I think that was a bug caused by the wrong command definitions. The options should be marked as "multiple": true:

rueidis/hack/cmds/commands_search.json

Lines 357 to 360 in 25821d0

{
"name": "options",
"type": "string"
}
I think we can have another PR to fix that.

Can I create the issue and raise PR if it's that small a change?

@rueian
Copy link
Copy Markdown
Collaborator

rueian commented Oct 25, 2024

Sure, thanks!

@imvtsl
Copy link
Copy Markdown
Contributor Author

imvtsl commented Oct 25, 2024

I created this issue for it. I will raise PR for it as soon as this PR is merged.

@rueian rueian merged commit b743fe0 into redis:main Oct 25, 2024
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.

how to add new index to old ones

2 participants