Configure Vector Store
Update the indexed metadata fields configuration for a vector store.
This replaces the current set of indexed metadata fields. Only indexed fields can be used for filtering during query, list, and count operations; non-indexed fields are still stored and returned, but cannot be filtered on.
Field Types: Only STRING, NUMBER, and BOOLEAN fields can be indexed (maximum 20 fields). OBJECT and LIST types are stored but cannot be indexed for filtering.
Adding Fields: New indexed fields can be added at any time. They are indexed for documents upserted after the change; to make existing documents filterable on a new field, re-upsert them.
Removing Fields: Omitting a field removes it from this configuration, so it can no longer be filtered on. The underlying index is append-only, so removal does not reclaim storage or reduce write overhead; the field stays in the physical index until the store is recreated. Prefer indexing only the fields you filter on.
Note: The name and embedding_config are immutable after creation.
Configure Vector Store
package main
import (
"context"
"fmt"
"github.com/scaleapi/sgp-dev-go"
"github.com/scaleapi/sgp-dev-go/option"
)
func main() {
client := sgpdev.NewClient(
option.WithAPIKey("My API Key"),
option.WithAccountID("My Account ID"),
)
vectorStore, err := client.VectorStores.Configure(
context.TODO(),
"vector_store_name",
sgpdev.VectorStoreConfigureParams{
IndexedMetadataFields: map[string]string{
"foo": "string",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", vectorStore.ID)
}
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"embedding_dimensions": 0,
"name": "name",
"updated_at": "2019-12-27T18:11:19.117Z",
"embedding_config": {
"model_deployment_id": "model_deployment_id",
"type": "models_api"
},
"indexed_metadata_fields": {
"foo": "string"
}
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"embedding_dimensions": 0,
"name": "name",
"updated_at": "2019-12-27T18:11:19.117Z",
"embedding_config": {
"model_deployment_id": "model_deployment_id",
"type": "models_api"
},
"indexed_metadata_fields": {
"foo": "string"
}
}