-
Notifications
You must be signed in to change notification settings - Fork 182
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 vector index #612
support vector index #612
Conversation
tugraph seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
…raph-db into dev-vector-index
…into dev-vector-index
test/test_vsag_index.cpp
Outdated
"CREATE (n:person {id:4, vector: [4.0,4.0,4.0,4.0]})"); | ||
UT_EXPECT_TRUE(ret); | ||
ret = client.CallCypher(str, | ||
"CALL vector.VectorIndexQuery('person','vector',[1,2,3,4], 2, 10)"); |
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.
CALL vector.VectorIndexQuery('person','vector',[1,2,3,4], 2, 10)") 这个返回结果是什么,向量检索的最终目的是用来查点的。
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.
返回结果是 对应的vid label_name field_name vector distance
@@ -123,6 +128,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | |||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") | |||
target_link_libraries(${TARGET_LGRAPH} PUBLIC | |||
vsag |
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.
vsag改成静态库编译
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.
vsag改成静态库编译
确认了,静态库搞不定,只能链接动态库
这一版,先暂时合并进去。 |
Support create vector index and query similarity
How to create a vertex which contains vector property:
eg:
CALL db.createVertexLabel('person', 'id', 'id', 'int64', false, 'vector', 'float_vector', true);
CREATE (n:person {id:2001, vector: [1.0,2.0,3.0]});
Create vector index:
vector.AddVectorIndex(label_name, field_name, index_type, vec_dimension, distance_type ,index_spec);
eg:for HNSW, it need 2 parameters for index_spec:Max_degree && ef_construction
CALL vector.AddVectorIndex('person', 'vector', 'HNSW', 4, 'L2' ,24 , 100);
Delete vector index:
vector.DeleteVectorIndex(label_name, field_name, index_type, vec_dimension, distance_type);
eg:
CALL vector.DeleteVectorIndex('person', 'vector', ' HNSW ', 4, 'L2');
Show vector index:
CALL vector.ShowVectorIndex();
Query by using vector index:
CALL vector.VectorIndexQuery(label_name, field_name, vector, vec_dimension, query_spec);
eg:for HNSW, it need 1 parameter for index_spec:ef_search
CALL vector.VectorIndexQuery('person', 'vector', [1,2,3,4], 4, 10);
What support now:
VSAG HNSW
TODO:
support more vector index algorithm and library