sincecutoff.com
← all changes

gcloud firestore indexes composite create adds search configuration options

Introduced 2026-05-12 · score 0.93

HOW TO USE IT

To create a beta composite Firestore search index, run `gcloud beta firestore indexes composite create` with a search-config field and, if needed, search-index-options.

gcloud beta firestore indexes composite create --database=<DATABASE_ID> --collection-group=<COLLECTION_GROUP> --field-config=field-path=<FIELD_NAME>,search-config='{"text-spec":{"index-specs":[{"index-type":"tokenized","match-type":"match-globally"}]}}' --search-index-options=text-language=<BCP47_LANGUAGE>

WHY THIS HELPS

Create a beta composite Firestore index with search configuration options.

REQUIREMENTS AND LIMITATIONS

  • Availability: beta
  • --collection-group (required): Collection group ID to index.
  • --database: Database ID; defaults to `(default)`.
  • --field-config (required): Index field configuration. `field-path` is required. A search field uses `search-config`; an index definition must contain only search-config fields or only non-search-config fields.
  • search-config.geo-spec: Geo search field specification. `geo-json-indexing-disabled` is an optional sub-key that disables GeoJSON indexing; by default GeoJSON points are indexed.
  • search-config.text-spec: Text search field specification. `index-specs` is an optional array; each entry requires `index-type` and `match-type`.
  • --search-index-options: Search index definition options. `text-language` is an optional BCP 47 language code used as the default; `text-language-override-field-path` is an optional document field path for per-document language. Docs do not state these sub-keys are mutually exclusive.
  • text-spec.index-specs[].index-type (required): Specifies how to index the text field value; documented example value: `tokenized`.
  • text-spec.index-specs[].match-type (required): Specifies how to match the text field value; documented example value: `match-globally`.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card