fix(python,java,node,rust): add missing vector search 1.1 args#5550
fix(python,java,node,rust): add missing vector search 1.1 args#5550
Conversation
aa2d96f to
77481b6
Compare
77481b6 to
42f6616
Compare
42f6616 to
605f21a
Compare
Signed-off-by: Edward Liang <edward.liang@improving.com>
605f21a to
ceec41f
Compare
| ) | ||
| assert await glide_client.hset(key1, {vec_field: vector1}) == 1 | ||
| assert await glide_client.hset(key2, {vec_field: vector2}) == 1 | ||
| time.sleep(self.sleep_wait_time) |
There was a problem hiding this comment.
We probably shouldnt be using time.sleep() for an async test
There was a problem hiding this comment.
I noticed that it was also a recurring pattern in the existing tests of this file. Should we replace them all?
| == OK | ||
| ) | ||
| assert await glide_client.hset(key1, {vec_field: vector1}) == 1 | ||
| time.sleep(self.sleep_wait_time) |
There was a problem hiding this comment.
similar here probably should not use time.sleep() which will blocking the thread
There was a problem hiding this comment.
Could you check the formatting for this file? The spacing seems weird.
There was a problem hiding this comment.
Talked with Kiro about it, but apparently it follows the Google Java Style convention. Running spotless checks also pass. I do agree formatting might be a bit weird but I think a lot of the existing Java files follow this convention so fixing it might be a project-wide task 😵💫
|
|
||
| @SneakyThrows | ||
| @Test | ||
| public void ft_search_nocontent() { |
There was a problem hiding this comment.
So from what I gathered, this test is doing:
- Insert 2 vectors into test db
- Search for them with NOCONTENT set.
- assert that the return value is correct.
The additional vector syntax make this test feels complicated for me. Since the focus is to check nocontent was applied, could we just use a simple set and get test with nocontent and assert the response?
There was a problem hiding this comment.
I think we should keep this test as is. The issue with NOCONTENT was that it had to change the way the response was converted in core. IMO, probably better to leave it like this to verify the parsing and everything isn't broken.
|
|
||
| FTSearchOptions options = | ||
| FTSearchOptions.builder() | ||
| .dialect(2) |
There was a problem hiding this comment.
Since only dialect 2 is supported, what is expected to happen if dialect 1 is specified?
There was a problem hiding this comment.
An error is thrown DIALECT requires a non negative integer >=2 and <= 4
Signed-off-by: Edward Liang <edward.liang@improving.com>
Summary
In Valkey Search 1.1, some arguments were missed in
FT.SEARCHsuch asDIALECTandNOCONTENT. This PR adds it and fixes the response handling in the core.Issue link
Closes #5626
Features / Behaviour Changes
DIALECTNOCONTENTImplementation
New args added for each language, response handling changed in the core
Limitations
Testing
New test cases have been added.
Checklist
Before submitting the PR make sure the following are checked:
make *-linttargets) and Prettier has been run (make prettier-fix).