-
Notifications
You must be signed in to change notification settings - Fork 69
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
Java: FT.CREATE
#2414
Java: FT.CREATE
#2414
Conversation
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Yury-Fridlyand <[email protected]>
113a983
to
c9d9fa1
Compare
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/commands/vss/FTCreateOptions.java
Outdated
Show resolved
Hide resolved
/** Type of the index dataset. */ | ||
public enum IndexType { | ||
/** Data stored in hashes, so field identifiers are field names within the hashes. */ | ||
HASH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
HASH, | |
HASH("ON HASH"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 2 different args
java/client/src/main/java/glide/api/models/commands/vss/FTCreateOptions.java
Outdated
Show resolved
Hide resolved
public static class NumericField implements Field { | ||
@Override | ||
public String[] toArgs() { | ||
return new String[] {FieldType.NUMERIC.toString()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use an enum here? a String works just as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A recommendation from @prateek-kumar-improving to use constants. Could be helpful when we use it in multiple places
private Optional<Character> separator; | ||
private final boolean caseSensitive; | ||
|
||
/** Create a <code>TAG</code> field. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning here? Should only be used for HASH index types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Can't find such thing in docs.
* | ||
* @param caseSensitive Whether to keep the original case. | ||
*/ | ||
public TagField(boolean caseSensitive) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning here? Should only be used for HASH index types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not find this in the documentation?
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
@NonNull String indexName, | ||
@NonNull FieldInfo[] fields, | ||
@NonNull FTCreateOptions options) { | ||
return create(client, gs(indexName), fields, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will accepting String parameter (indexName
here) but passing the GlideString version to customCommand() affect the output of the command anyhow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a binary version of custom command is used. I hope no.
@SneakyThrows | ||
public void check_module_loaded() { | ||
var client = | ||
public static void init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is this approach of creating a single client and share it among all tests preferred over creating a new client for every tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no preference so far. Do whatever you like in your tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small comments - please address before merging
java/client/src/main/java/glide/api/models/commands/FT/FTCreateOptions.java
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/commands/FT/FTCreateOptions.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/commands/FT/FTCreateOptions.java
Outdated
Show resolved
Hide resolved
@@ -9,8 +9,10 @@ | |||
exports glide.api.models.commands.function; | |||
exports glide.api.models.commands.scan; | |||
exports glide.api.models.commands.stream; | |||
exports glide.api.models.commands.FT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
java/integTest/src/test/java/glide/modules/VectorSearchTests.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/commands/FT/FTCreateOptions.java
Show resolved
Hide resolved
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]> Signed-off-by: Muhammad Awawdi <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Issue link
#2428
Checklist
Before submitting the PR make sure the following are checked: