capiono
capiono

Reputation: 2997

Error creating single-field vector index in Firestore with gcloud CLI

I'm trying to create a single-field vector index in my Firestore database using the gcloud command-line interface (CLI) to enable vector search functionality.

However, I keep getting this error:

ERROR: (gcloud.alpha.firestore.indexes.composite.create) Invalid value for [--field-config]: Composite indexes must be configured with at least 2 fields. For single-field index management, use the commands under gcloud firestore indexes fields.

This is the command I'm running, based on the official documentation and what is returned when I try to query the collection:

gcloud alpha firestore indexes composite create --collection-group=People --query-scope=COLLECTION --field-config field-path="embedding",vector-config='{"dimension":"768", "flat": "{}"}'

I've confirmed that:

I understand this functionality is still in alpha, but I think the documentation is broken because it uses the composite command to create a single field index.

How can I create a single-field vector index in Firestore using the gcloud CLI?

Upvotes: 2

Views: 254

Answers (0)

Related Questions