GoogleFirestoreAdminV1Index

Cloud Firestore indexes enable simple and complex queries against documents in a database. In Standard edition databases, single-field indexes are managed using the google.firestore.admin.v1.Field resource, and composite indexes are managed using the google.firestore.admin.v1.Index resource. In Enterprise edition databases, both single-field and composite indexes are managed using the google.firestore.admin.v1.Index resource.

DatabaseDocumentsGoogle CloudNoSQLReal-Time

Properties

Name Type Description
apiScope string The API scope supported by this index.
fields array The fields supported by this index. At most 100 fields may be specified. In Standard edition databases only: - At least 2 fields must be specified. - The last field entry is always for the field path
state string Output only. The serving state of the index.
queryScope string Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection ID. Indexes with
unique boolean Optional. Whether it is an unique index. Unique index ensures all values for the indexed field(s) are unique across documents.
searchIndexOptions object Optional. Options for search indexes that are at the index definition level. This field is only currently supported for indexes with MONGODB_COMPATIBLE_API ApiScope.
name string A server-defined name for this index. Output only. When used in the google.firestore.admin.v1.Index resource, the value is of the form: `projects/{project_id}/databases/{database_id}/collectionGroups/
shardCount integer Optional. The number of physical shards for the index. In Cloud Firestore, data and index entries are stored in contiguous, ordered key ranges called splits. While document keys within a collection ar
density string Immutable. The density configuration of the index.
multikey boolean Optional. Whether the index is multikey. By default, the index is not multikey. For non-multikey indexes, none of the paths in the index definition reach or traverse an array, except via an explicit a
View JSON Schema on GitHub

JSON Schema

google-cloud-firestore-google-firestore-admin-v1-index-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-firestore/json-schema/google-cloud-firestore-google-firestore-admin-v1-index-schema.json",
  "title": "GoogleFirestoreAdminV1Index",
  "description": "Cloud Firestore indexes enable simple and complex queries against documents in a database. In Standard edition databases, single-field indexes are managed using the google.firestore.admin.v1.Field resource, and composite indexes are managed using the google.firestore.admin.v1.Index resource. In Enterprise edition databases, both single-field and composite indexes are managed using the google.firestore.admin.v1.Index resource.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-firestore-projects-api-openapi.yml#/components/schemas/GoogleFirestoreAdminV1Index",
  "type": "object",
  "properties": {
    "apiScope": {
      "description": "The API scope supported by this index.",
      "type": "string",
      "enum": [
        "ANY_API",
        "DATASTORE_MODE_API",
        "MONGODB_COMPATIBLE_API"
      ]
    },
    "fields": {
      "items": {
        "$ref": "#/$defs/GoogleFirestoreAdminV1IndexField"
      },
      "description": "The fields supported by this index. At most 100 fields may be specified. In Standard edition databases only: - At least 2 fields must be specified. - The last field entry is always for the field path `__name__`. If, on creation, `__name__` was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in the index is not directional, the `__name__` will be ordered ASCENDING (unless explicitly specified).",
      "type": "array"
    },
    "state": {
      "description": "Output only. The serving state of the index.",
      "type": "string",
      "enum": [
        "STATE_UNSPECIFIED",
        "CREATING",
        "READY",
        "NEEDS_REPAIR"
      ]
    },
    "queryScope": {
      "description": "Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection ID. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection ID as this index.",
      "type": "string",
      "enum": [
        "QUERY_SCOPE_UNSPECIFIED",
        "COLLECTION",
        "COLLECTION_GROUP",
        "COLLECTION_RECURSIVE"
      ]
    },
    "unique": {
      "description": "Optional. Whether it is an unique index. Unique index ensures all values for the indexed field(s) are unique across documents.",
      "type": "boolean"
    },
    "searchIndexOptions": {
      "$ref": "#/$defs/GoogleFirestoreAdminV1SearchIndexOptions",
      "description": "Optional. Options for search indexes that are at the index definition level. This field is only currently supported for indexes with MONGODB_COMPATIBLE_API ApiScope."
    },
    "name": {
      "type": "string",
      "description": "A server-defined name for this index. Output only. When used in the google.firestore.admin.v1.Index resource, the value is of the form: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` When used in the google.firestore.admin.v1.Field resource, the value is empty."
    },
    "shardCount": {
      "format": "int32",
      "description": "Optional. The number of physical shards for the index. In Cloud Firestore, data and index entries are stored in contiguous, ordered key ranges called splits. While document keys within a collection are hashed to distribute write traffic across splits, secondary index entries are ordered lexicographically by their indexed field values. When an index contains fields with sequential or monotonically increasing or decreasing values (such as timestamps or auto-incrementing IDs), every incoming index write targets the boundary of the index keyspace on a single split. Because sequential writes continuously advance to the newest split at the edge of the range, automatic load-based splitting cannot divide the write traffic across storage servers. Under high write rates, this concentration creates an append hotspot on that single split, resulting in elevated write latency, contention errors, and transaction aborts. Sharded indexes solve this write bottleneck by hash partitioning the secondary index keyspace. When `shard_count` is configured to N, Firestore automatically prepends a virtual computed shard field (with values from 0 to N-1) as the leading field of the index. This splits a single sequential key range into N independent key ranges, uniformly scattering adjacent writes across distinct splits and storage servers to enable linear write scaling. Query trade-offs: Hash partitioning trades query performance for write throughput. Because matching index entries are scattered across all shards, queries executing against a sharded index cannot read from a single contiguous range. The query engine must fan out parallel seeks across all N shards and merge the ordered results. Even index point lookups and queries with `LIMIT 1` must seek across all N shards. Sizing and best practices: - Indexes cannot be updated in-place. `shard_count` is immutable once an index is created; to \"reshard\" an index, create a new index with the desired `shard_count` and delete the original index. - Use sharded indexes only for indexes experiencing write bottlenecks (typically exceeding 500-1,000 writes/sec) on sequential or timestamp fields. - Do not shard indexes on uniformly distributed fields (such as UUIDs or hash tokens), where writes naturally spread across splits without sharding. Sharding uniform indexes adds query overhead without improving write throughput. - Do not shard read-heavy or low-write collections. - Size `shard_count` based on expected peak write throughput. Because a single split sustains roughly 500-1,000 writes/sec on sequential keys, estimate `shard_count ≈ ceil(peak_write_qps / 500)`. - e.g., 4 for up to ~2,000-4,000 writes/sec, 16 for up to ~10,000+ writes/sec. - Setting an excessively high shard count produces diminishing write returns while needlessly increasing read latency and seek costs. If <= 1, the index is unsharded (1 physical shard).",
      "type": "integer"
    },
    "density": {
      "type": "string",
      "enum": [
        "DENSITY_UNSPECIFIED",
        "SPARSE_ALL",
        "SPARSE_ANY",
        "DENSE"
      ],
      "description": "Immutable. The density configuration of the index."
    },
    "multikey": {
      "description": "Optional. Whether the index is multikey. By default, the index is not multikey. For non-multikey indexes, none of the paths in the index definition reach or traverse an array, except via an explicit array index. For multikey indexes, at most one of the paths in the index definition reach or traverse an array, except via an explicit array index. Violations will result in errors. Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.",
      "type": "boolean"
    }
  },
  "$defs": {
    "GoogleFirestoreAdminV1FlatIndex": {
      "type": "object",
      "description": "An index that stores vectors in a flat data structure, and supports exhaustive search.",
      "properties": {}
    },
    "GoogleFirestoreAdminV1IndexField": {
      "type": "object",
      "description": "A field in an index. The field_path describes which field is indexed, the value_mode describes how the field value is indexed.",
      "properties": {
        "arrayConfig": {
          "description": "Indicates that this field supports operations on `array_value`s.",
          "type": "string",
          "enum": [
            "ARRAY_CONFIG_UNSPECIFIED",
            "CONTAINS"
          ]
        },
        "fieldPath": {
          "type": "string",
          "description": "Can be __name__. For single field indexes, this must match the name of the field or may be omitted."
        },
        "order": {
          "type": "string",
          "enum": [
            "ORDER_UNSPECIFIED",
            "ASCENDING",
            "DESCENDING"
          ],
          "description": "Indicates that this field supports ordering by the specified order or comparing using =, !=, <, <=, >, >=."
        },
        "vectorConfig": {
          "$ref": "#/$defs/GoogleFirestoreAdminV1VectorConfig",
          "description": "Indicates that this field supports nearest neighbor and distance operations on vector."
        },
        "searchConfig": {
          "$ref": "#/$defs/GoogleFirestoreAdminV1SearchConfig",
          "description": "Indicates that this field supports search operations."
        }
      }
    },
    "GoogleFirestoreAdminV1SearchConfig": {
      "type": "object",
      "description": "The configuration for how to index a field for search.",
      "properties": {
        "textSpec": {
          "$ref": "#/$defs/GoogleFirestoreAdminV1SearchTextSpec",
          "description": "Optional. The specification for building a text search index for a field."
        },
        "geoSpec": {
          "$ref": "#/$defs/GoogleFirestoreAdminV1SearchGeoSpec",
          "description": "Optional. The specification for building a geo search index for a field."
        }
      }
    },
    "GoogleFirestoreAdminV1SearchGeoSpec": {
      "type": "object",
      "properties": {
        "geoJsonIndexingDisabled": {
          "description": "Optional. Disables geoJSON indexing for the field. By default, geoJSON points are indexed. Firestore GeoPoints are indexed regardless of the value of this field.",
          "type": "boolean"
        }
      },
      "description": "The specification for how to build a geo search index for a field."
    },
    "GoogleFirestoreAdminV1SearchIndexOptions": {
      "type": "object",
      "properties": {
        "textLanguage": {
          "type": "string",
          "description": "Optional. The language to use for text search indexes. Used as the default language if not overridden at the document level by specifying the `text_language_override_field`. The language is specified as a BCP 47 language code. For indexes with MONGODB_COMPATIBLE_API ApiScope: If unspecified, the default language is English. For indexes with `ANY_API` ApiScope: If unspecified, the default behavior is autodetect."
        },
        "textLanguageOverrideFieldPath": {
          "description": "Optional. The field in the document that specifies which language to use for that specific document. For indexes with MONGODB_COMPATIBLE_API ApiScope: if unspecified, the language is taken from the \"language\" field if it exists or from `text_language` if it does not.",
          "type": "string"
        }
      },
      "description": "Options for search indexes at the definition level."
    },
    "GoogleFirestoreAdminV1SearchTextIndexSpec": {
      "properties": {
        "indexType": {
          "type": "string",
          "enum": [
            "TEXT_INDEX_TYPE_UNSPECIFIED",
            "TOKENIZED"
          ],
          "description": "Required. How to index the text field value."
        },
        "matchType": {
          "type": "string",
          "enum": [
            "TEXT_MATCH_TYPE_UNSPECIFIED",
            "MATCH_GLOBALLY"
          ],
          "description": "Required. How to match the text field value."
        }
      },
      "description": "Specification of how the field should be indexed for search text indexes.",
      "type": "object"
    },
    "GoogleFirestoreAdminV1SearchTextSpec": {
      "description": "The specification for how to build a text search index for a field.",
      "properties": {
        "indexSpecs": {
          "items": {
            "$ref": "#/$defs/GoogleFirestoreAdminV1SearchTextIndexSpec"
          },
          "type": "array",
          "description": "Required. Specifications for how the field should be indexed. Repeated so that the field can be indexed in multiple ways."
        }
      },
      "type": "object"
    },
    "GoogleFirestoreAdminV1VectorConfig": {
      "type": "object",
      "properties": {
        "dimension": {
          "description": "Required. The vector dimension this configuration applies to. The resulting index will only include vectors of this dimension, and can be used for vector search with the same dimension.",
          "type": "integer",
          "format": "int32"
        },
        "flat": {
          "$ref": "#/$defs/GoogleFirestoreAdminV1FlatIndex",
          "description": "Indicates the vector index is a flat index."
        }
      },
      "description": "The index configuration to support vector search operations"
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/google-cloud-firestore-google-firestore-admin-v1-index"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.