I'm trying to create a single-field vector index in my Firestore database using the gcloud command-line interface (alpha) 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 C
Hey, try running the command directly into shell/terminal available at console.cloud.google.com. worked for me.
This seems to work but it is a work-around.