Skip to content

Commit

Permalink
write nil for index type by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-spike committed Oct 17, 2024
1 parent 3c27d1c commit 8919991
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ func (c *Client) IndexCreate(
Params: params,
Labels: labels,
Storage: storage,
Type: ptr(protos.IndexType_HNSW),
Type: nil, // defaults to protos.IndexType_HNSW
}

return c.IndexCreateFromIndexDef(ctx, indexDef)
Expand Down
4 changes: 0 additions & 4 deletions integration_single_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ func (suite *SingleNodeTestSuite) TestIndexCreate() {
},
Dimensions: uint32(10),
VectorDistanceMetric: ptr(protos.VectorDistanceMetric_SQUARED_EUCLIDEAN),
Type: ptr(protos.IndexType_HNSW),
SetFilter: nil,
Field: "vector",
},
Expand Down Expand Up @@ -297,7 +296,6 @@ func (suite *SingleNodeTestSuite) TestIndexCreate() {
},
Dimensions: uint32(10),
VectorDistanceMetric: ptr(protos.VectorDistanceMetric_COSINE),
Type: ptr(protos.IndexType_HNSW),
SetFilter: ptr("testset"),
Field: "vector",
Storage: &protos.IndexStorage{
Expand Down Expand Up @@ -378,7 +376,6 @@ func (suite *SingleNodeTestSuite) TestIndexUpdate() {
},
Dimensions: uint32(10),
VectorDistanceMetric: ptr(protos.VectorDistanceMetric_COSINE),
Type: ptr(protos.IndexType_HNSW),
SetFilter: ptr("testset"),
Field: "vector",
Storage: &protos.IndexStorage{
Expand Down Expand Up @@ -442,7 +439,6 @@ func (suite *SingleNodeTestSuite) TestIndexUpdate() {
},
Dimensions: uint32(10),
VectorDistanceMetric: ptr(protos.VectorDistanceMetric_COSINE),
Type: ptr(protos.IndexType_HNSW),
SetFilter: ptr("testset"),
Field: "vector",
Storage: &protos.IndexStorage{
Expand Down
2 changes: 1 addition & 1 deletion testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (idb *indexDefinitionBuilder) Build() *protos.IndexDefinition {
Dimensions: uint32(idb.dimension),
VectorDistanceMetric: &idb.vectorDistanceMetric,
Field: idb.vectorField,
Type: ptr(protos.IndexType_HNSW),
Type: nil, // defaults to protos.IndexType_HNSW
Storage: &protos.IndexStorage{
Namespace: &idb.namespace,
Set: &idb.indexName,
Expand Down

0 comments on commit 8919991

Please sign in to comment.