ensureFulltextIndex method

Future<Map<String, dynamic>> ensureFulltextIndex(
  1. List<String> fields,
  2. {int minLength}
)

Implementation

Future<Map<String, dynamic>> ensureFulltextIndex(
  List<String> fields, {
  int minLength,
}) async {
  final resp = await _connection.request(
    method: 'POST',
    path: '/_api/index',
    body: {
      'type': 'fulltext',
      'fields': fields,
      if (minLength != null) 'minLength': minLength,
    },
    queries: {'collection': name},
  );
  return resp.body;
}