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 adding vector index to the Database Model #67

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Oct 23, 2024

What's changed

  • Introduce class VectorIndex and overwrite the create_sql for building the SQL of CREATE VECTOR INDEX ... ON ...
  • Support using L1Distance/L2Distance/CosineDistance/NegativeInnerProduct as expression index
  • Bump the version from 5.0.0 to 5.0.1, so that other libraries can update their requirements version to get the vector index definition

Signed-off-by: JaySon-Huang <tshent@qq.com>
@sre-bot
Copy link

sre-bot commented Oct 23, 2024

CLA assistant check
All committers have signed the CLA.

@wd0517
Copy link
Collaborator

wd0517 commented Nov 5, 2024

Good Job!

Please also add some tests for vector index in this file https://github.com/pingcap/django-tidb/blob/main/tests/tidb_vector/test_vector.py

JaySon-Huang and others added 3 commits November 5, 2024 14:51
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented Nov 5, 2024

I've added some test case and polish the document.
And also bump the version to 5.0.1 so that other libraries (for example, tidb-vector-python) can update their requirements version to get the vector index definition with "django-tidb==5.0.1"

@wd0517 PTAL again

@wd0517 wd0517 merged commit 9e7027c into pingcap:main Nov 5, 2024
11 checks passed
@JaySon-Huang JaySon-Huang deleted the support_vector_index branch November 5, 2024 09:46
@wd0517
Copy link
Collaborator

wd0517 commented Nov 5, 2024

I'll cherry-pick this feature to stable/4.2.x and stable/4.1.x branch later.

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