Skip to content

Commit

Permalink
Fixes 4087: Add vector info procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcostam committed Jul 11, 2024
1 parent 72083fd commit 2d4de27
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ With hostOrKey=null, the default is 'http://localhost:8000'.
CALL apoc.vectordb.chroma.info(hostOrKey, 'test_collection', {<optional config>})
----

.Example results
[opts="header"]
|===
| value
| {name=test_collection, metadata={size=4, hnsw:space=cosine}, database=default_database, id=74ebe008-1ccb-4d3d-8c5d-cdd7cfa526c2, tenant=default_tenant}
|===

.Create a collection (it leverages https://docs.trychroma.com/usage-guide#creating-inspecting-and-deleting-collections[this API])
[source,cypher]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Here is a list of all available Milvus procedures:
[opts=header, cols="1, 3"]
|===
| name | description
| apoc.vectordb.milvus.info(hostOrKey, collection, $config) | Get collection info
| apoc.vectordb.milvus.info(hostOrKey, collection, $config) | Get information about specified existing collection
| apoc.vectordb.milvus.createCollection(hostOrKey, collection, similarity, size, $config) |
Creates a collection, with the name specified in the 2nd parameter, and with the specified `similarity` and `size`.
The default endpoint is `<hostOrKey param>/v2/vectordb/collections/create`.
Expand Down Expand Up @@ -43,9 +43,16 @@ Here is a list of example using a local installation using th default port `1953
.Get collection info (it leverages https://milvus.io/docs/manage-collections.md#View-Collections[this API])
[source,cypher]
----
CALL apoc.vectordb.milvus.createCollection('http://localhost:19531', 'test_collection', 'COSINE', 4, {<optional config>})
CALL apoc.vectordb.milvus.info($host, 'test_collection', '', {<optional config>})
----

.Example results
[opts="header"]
|===
| value
| {data={shardsNum=1, aliases=[], autoId=false, description=, partitionsNum=1, collectionName=test_collection, indexes=[{metricType=COSINE, indexName=vector, fieldName=vector}], load=LoadStateLoading, consistencyLevel=Bounded, fields=[{partitionKey=false, autoId=false, name=id, description=, id=100, type=Int64, primaryKey=true}, {partitionKey=false, autoId=false, name=vector, description=, id=101, params=[{value=4, key=dim}], type=FloatVector, primaryKey=false}], collectionID=451046728334049293, enableDynamicField=true, properties=[]}, message=, code=200}
|===

.Create a collection (it leverages https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Create.md[this API])
[source,cypher]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ With hostOrKey=null, the default is 'http://localhost:6333'.
CALL apoc.vectordb.qdrant.info(hostOrKey, 'test_collection', {<optional config>})
----

.Example results
[opts="header"]
|===
| value
| {result={optimizer_status=ok, points_count=2, vectors_count=2, segments_count=8, indexed_vectors_count=0, config={params={on_disk_payload=true, vectors={size=4, distance=Cosine}, shard_number=1, replication_factor=1, write_consistency_factor=1}, optimizer_config={max_optimization_threads=1, indexing_threshold=20000, deleted_threshold=0.2, flush_interval_sec=5, memmap_threshold=null, default_segment_number=0, max_segment_size=null, vacuum_min_vector_number=1000}, quantization_config=null, hnsw_config={max_indexing_threads=0, full_scan_threshold=10000, ef_construct=100, m=16, on_disk=false}, wal_config={wal_segments_ahead=0, wal_capacity_mb=32}}, status=green, payload_schema={}}, time=1.2725E-4, status=ok}
|===

.Create a collection (it leverages https://qdrant.github.io/qdrant/redoc/index.html#tag/collections/operation/create_collection[this API])
[source,cypher]
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ With hostOrKey=null, the default is 'http://localhost:8080/v1'.
CALL apoc.vectordb.weaviate.info($host, 'test_collection', {<optional config>})
----

.Example results
[opts="header"]
|===
| value
| {vectorizer=none, invertedIndexConfig={bm25={b=0.75, k1=1.2}, stopwords={additions=null, removals=null, preset=en}, cleanupIntervalSeconds=60}, vectorIndexConfig={ef=-1, dynamicEfMin=100, pq={centroids=256, trainingLimit=100000, encoder={type=kmeans, distribution=log-normal}, enabled=false, bitCompression=false, segments=0}, distance=cosine, skip=false, dynamicEfFactor=8, bq={enabled=false}, vectorCacheMaxObjects=1000000000000, cleanupIntervalSeconds=300, dynamicEfMax=500, efConstruction=128, flatSearchCutoff=40000, maxConnections=64}, multiTenancyConfig={enabled=false}, vectorIndexType=hnsw, replicationConfig={factor=1}, shardingConfig={desiredVirtualCount=128, desiredCount=1, actualCount=1, function=murmur3, virtualPerPhysical=128, strategy=hash, actualVirtualCount=128, key=_id}, class=TestCollection, properties=[{name=city, description=This property was generated by Weaviate's auto-schema feature on Wed Jul 10 12:50:18 2024, indexFilterable=true, tokenization=word, indexSearchable=true, dataType=[text]}, {name=foo, description=This property was generated by Weaviate's auto-schema feature on Wed Jul 10 12:50:18 2024, indexFilterable=true, tokenization=word, indexSearchable=true, dataType=[text]}]}
|===

.Create a collection (it leverages https://weaviate.io/developers/weaviate/api/rest#tag/schema/post/schema[this API])
[source,cypher]
----
Expand Down
2 changes: 1 addition & 1 deletion extended/src/main/java/apoc/vectordb/Weaviate.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Weaviate {
public URLAccessChecker urlAccessChecker;

@Procedure("apoc.vectordb.weaviate.info")
@Description("apoc.vectordb.weaviate.info(hostOrKey, collection, $configuration) - Creates a collection, with the name specified in the 2nd parameter, and with the specified `similarity` and `size`")
@Description("apoc.vectordb.weaviate.info(hostOrKey, collection, $configuration) - Get information about specified existing collection")
public Stream<MapResult> createCollection(@Name("hostOrKey") String hostOrKey,
@Name("collection") String collection,
@Name(value = "configuration", defaultValue = "{}") Map<String, Object> configuration) throws Exception {
Expand Down

0 comments on commit 2d4de27

Please sign in to comment.