Class: Google::Cloud::Firestore::Admin::V1::Index

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/firestore/admin/v1/index.rb

Overview

Cloud Firestore indexes enable simple and complex queries against documents in a database.

Defined Under Namespace

Modules: ApiScope, Density, QueryScope, State Classes: IndexField

Instance Attribute Summary collapse

Instance Attribute Details

#api_scope::Google::Cloud::Firestore::Admin::V1::Index::ApiScope

Returns The API scope supported by this index.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#density::Google::Cloud::Firestore::Admin::V1::Index::Density

Returns Immutable. The density configuration of the index.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#fields::Array<::Google::Cloud::Firestore::Admin::V1::Index::IndexField>

Returns The fields supported by this index.

For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. 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 a composite index is not directional, the __name__ will be ordered ASCENDING (unless explicitly specified).

For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.

Returns:

  • (::Array<::Google::Cloud::Firestore::Admin::V1::Index::IndexField>)

    The fields supported by this index.

    For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. 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 a composite index is not directional, the __name__ will be ordered ASCENDING (unless explicitly specified).

    For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#multikey::Boolean

Returns 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.

Returns:

  • (::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 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.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#name::String

Returns Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.

Returns:

  • (::String)

    Output only. A server defined name for this index. The form of this name for composite indexes will be: projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id} For single field indexes, this field will be empty.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#query_scope::Google::Cloud::Firestore::Admin::V1::Index::QueryScope

Returns 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.

Returns:

  • (::Google::Cloud::Firestore::Admin::V1::Index::QueryScope)

    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.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#shard_count::Integer

Returns Optional. The number of shards for the index.

Returns:

  • (::Integer)

    Optional. The number of shards for the index.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#state::Google::Cloud::Firestore::Admin::V1::Index::State

Returns Output only. The serving state of the index.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end

#unique::Boolean

Returns Optional. Whether it is an unique index. Unique index ensures all values for the indexed field(s) are unique across documents.

Returns:

  • (::Boolean)

    Optional. Whether it is an unique index. Unique index ensures all values for the indexed field(s) are unique across documents.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'proto_docs/google/firestore/admin/v1/index.rb', line 81

class Index
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A field in an index.
  # The field_path describes which field is indexed, the value_mode describes
  # how the field value is indexed.
  # @!attribute [rw] field_path
  #   @return [::String]
  #     Can be __name__.
  #     For single field indexes, this must match the name of the field or may
  #     be omitted.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order]
  #     Indicates that this field supports ordering by the specified order or
  #     comparing using =, !=, <, <=, >, >=.
  #
  #     Note: The following fields are mutually exclusive: `order`, `array_config`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] array_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig]
  #     Indicates that this field supports operations on `array_value`s.
  #
  #     Note: The following fields are mutually exclusive: `array_config`, `order`, `vector_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] vector_config
  #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig]
  #     Indicates that this field supports nearest neighbor and distance
  #     operations on vector.
  #
  #     Note: The following fields are mutually exclusive: `vector_config`, `order`, `array_config`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class IndexField
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The index configuration to support vector search operations
    # @!attribute [rw] dimension
    #   @return [::Integer]
    #     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.
    # @!attribute [rw] flat
    #   @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex]
    #     Indicates the vector index is a flat index.
    class VectorConfig
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # An index that stores vectors in a flat data structure, and supports
      # exhaustive search.
      class FlatIndex
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods
      end
    end

    # The supported orderings.
    module Order
      # The ordering is unspecified. Not a valid option.
      ORDER_UNSPECIFIED = 0

      # The field is ordered by ascending field value.
      ASCENDING = 1

      # The field is ordered by descending field value.
      DESCENDING = 2
    end

    # The supported array value configurations.
    module ArrayConfig
      # The index does not support additional array queries.
      ARRAY_CONFIG_UNSPECIFIED = 0

      # The index supports array containment queries.
      CONTAINS = 1
    end
  end

  # Query Scope defines the scope at which a query is run. This is specified on
  # a StructuredQuery's `from` field.
  module QueryScope
    # The query scope is unspecified. Not a valid option.
    QUERY_SCOPE_UNSPECIFIED = 0

    # 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 collection ID specified by the index.
    COLLECTION = 1

    # Indexes with a collection group query scope specified allow queries
    # against all collections that has the collection ID specified by the
    # index.
    COLLECTION_GROUP = 2

    # Include all the collections's ancestor in the index. Only available for
    # Datastore Mode databases.
    COLLECTION_RECURSIVE = 3
  end

  # API Scope defines the APIs (Firestore Native, or Firestore in
  # Datastore Mode) that are supported for queries.
  module ApiScope
    # The index can only be used by the Firestore Native query API.
    # This is the default.
    ANY_API = 0

    # The index can only be used by the Firestore in Datastore Mode query API.
    DATASTORE_MODE_API = 1

    # The index can only be used by the MONGODB_COMPATIBLE_API.
    MONGODB_COMPATIBLE_API = 2
  end

  # The state of an index. During index creation, an index will be in the
  # `CREATING` state. If the index is created successfully, it will transition
  # to the `READY` state. If the index creation encounters a problem, the index
  # will transition to the `NEEDS_REPAIR` state.
  module State
    # The state is unspecified.
    STATE_UNSPECIFIED = 0

    # The index is being created.
    # There is an active long-running operation for the index.
    # The index is updated when writing a document.
    # Some index data may exist.
    CREATING = 1

    # The index is ready to be used.
    # The index is updated when writing a document.
    # The index is fully populated from all stored documents it applies to.
    READY = 2

    # The index was being created, but something went wrong.
    # There is no active long-running operation for the index,
    # and the most recently finished long-running operation failed.
    # The index is not updated when writing a document.
    # Some index data may exist.
    # Use the google.longrunning.Operations API to determine why the operation
    # that last attempted to create this index failed, then re-create the
    # index.
    NEEDS_REPAIR = 3
  end

  # The density configuration for the index.
  module Density
    # Unspecified. It will use database default setting. This value is input
    # only.
    DENSITY_UNSPECIFIED = 0

    # An index entry will only exist if ALL fields are present in the document.
    #
    # This is both the default and only allowed value for Standard Edition
    # databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
    # `DATASTORE_MODE_API`).
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
    # entry for this document since `a`, 'b', `c`, and `__name__` are all
    # present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
    # an index entry for this document since `d` is missing.
    #
    # This means that such indexes can only be used to serve a query when the
    # query has either implicit or explicit requirements that all fields from
    # the index are present.
    SPARSE_ALL = 1

    # An index entry will exist if ANY field are present in the document.
    #
    # This is used as the definition of a sparse index for Enterprise Edition
    # databases.
    #
    # Take for example the following document:
    #
    # ```
    # {
    #   "__name__": "...",
    #   "a": 1,
    #   "b": 2,
    #   "c": 3
    # }
    # ```
    #
    # an index on `(a ASC, d ASC)` will generate an index entry for this
    # document since `a` is present, and will fill in an `unset` value for `d`.
    # An index on `(d ASC, e ASC)` will not generate any index entry as neither
    # `d` nor `e` are present.
    #
    # An index that contains `__name__` will generate an index entry for all
    # documents since Firestore guarantees that all documents have a `__name__`
    # field.
    SPARSE_ANY = 2

    # An index entry will exist regardless of if the fields are present or not.
    #
    # This is the default density for an Enterprise Edition database.
    #
    # The index will store `unset` values for fields that are not present in
    # the document.
    DENSE = 3
  end
end