setIndexConfiguration method

  1. @Deprecated('setIndexConfiguration() has been deprecated. Please use `PersistentCacheIndexManager` instead.')
Future<void> setIndexConfiguration({
  1. required List<Index> indexes,
  2. List<FieldOverrides>? fieldOverrides,
})

Configures indexing for local query execution. Any previous index configuration is overridden.

The index entries themselves are created asynchronously. You can continue to use queries that require indexing even if the indices are not yet available. Query execution will automatically start using the index once the index entries have been written.

This API is now deprecated

Implementation

@Deprecated(
  'setIndexConfiguration() has been deprecated. Please use `PersistentCacheIndexManager` instead.',
)
Future<void> setIndexConfiguration({
  required List<Index> indexes,
  List<FieldOverrides>? fieldOverrides,
}) async {
  String json = jsonEncode(
    {
      'indexes': indexes.map((index) => index.toMap()).toList(),
      'fieldOverrides':
          fieldOverrides?.map((index) => index.toMap()).toList() ?? [],
    },
  );

  return _delegate.setIndexConfiguration(json);
}