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

Support for Vector Fields for Vector Similarity Search #2041

Merged
merged 15 commits into from
Mar 23, 2022

Conversation

Avital-Fine
Copy link
Contributor

@Avital-Fine Avital-Fine commented Mar 9, 2022

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Please provide a description of the change here.

@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2022

Codecov Report

Merging #2041 (f22fa92) into master (878e2f2) will increase coverage by 0.01%.
The diff coverage is 97.50%.

@@            Coverage Diff             @@
##           master    #2041      +/-   ##
==========================================
+ Coverage   91.19%   91.21%   +0.01%     
==========================================
  Files         100      100              
  Lines       21248    21319      +71     
==========================================
+ Hits        19378    19447      +69     
- Misses       1870     1872       +2     
Impacted Files Coverage Δ
redis/commands/search/field.py 98.48% <95.23%> (-1.52%) ⬇️
tests/test_search.py 99.15% <100.00%> (+0.01%) ⬆️
redis/asyncio/client.py 90.45% <0.00%> (-0.18%) ⬇️
redis/cluster.py 91.82% <0.00%> (ø)
tests/test_cluster.py 97.53% <0.00%> (+0.03%) ⬆️
redis/commands/cluster.py 93.47% <0.00%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 878e2f2...f22fa92. Read the comment docs.

@Avital-Fine Avital-Fine changed the title Support Vector field in FT.CREATE command Support Vector field in Schema Mar 9, 2022
@Avital-Fine Avital-Fine changed the title Support Vector field in Schema VecSim - Support Vector field in Schema Mar 9, 2022
@chayim chayim added the feature New feature label Mar 10, 2022
@chayim chayim changed the title VecSim - Support Vector field in Schema Add Vector Field support for Vector Similarity Searches Mar 10, 2022
@chayim chayim changed the title Add Vector Field support for Vector Similarity Searches Support for Vector Fields for Search Mar 10, 2022
@chayim chayim changed the title Support for Vector Fields for Search Support for Vector Fields for Vector Similarity Search Mar 10, 2022
modclient.ft().create_index(
(
VectorField(
"v", "HNSW", ["TYPE", "FLOAT32", "DIM", 2, "DISTANCE_METRIC", "L2"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chayim Maybe it's better to pass the attributes as a dictionary?

Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a bit clunky. I'd like to two do things before we merge:

  1. Try the dictionary approach (and document the kwargs)
  2. Add a jupyter notebook example.

WDYT @Avital-Fine ?

@chayim chayim self-requested a review March 13, 2022 14:59
@Avital-Fine Avital-Fine requested review from chayim and dvora-h March 15, 2022 09:54
@dvora-h
Copy link
Collaborator

dvora-h commented Mar 21, 2022

Can you add your example to examples.rst? (and test it locally)

@dvora-h
Copy link
Collaborator

dvora-h commented Mar 23, 2022

@Avital-Fine We want to merge it in before 4.2.0 release but the examples were broken so I moved them to a separate branch and after it will be fixed we will merged it too

@dvora-h dvora-h merged commit 019f651 into redis:master Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants