defineIndexField method

Future<DefineIndexFieldResponse> defineIndexField({
  1. required String domainName,
  2. required IndexField indexField,
})

Configures an IndexField for the search domain. Used to create new fields and modify existing ones. You must specify the name of the domain you are configuring and an index field configuration. The index field configuration specifies a unique name, the index field type, and the options you want to configure for the field. The options you can specify depend on the IndexFieldType. If the field exists, the new configuration replaces the old one. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.

May throw BaseException. May throw InternalException. May throw LimitExceededException. May throw InvalidTypeException. May throw ResourceNotFoundException.

Parameter indexField : The index field and field options you want to configure.

Implementation

Future<DefineIndexFieldResponse> defineIndexField({
  required String domainName,
  required IndexField indexField,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  ArgumentError.checkNotNull(indexField, 'indexField');
  final $request = <String, dynamic>{};
  $request['DomainName'] = domainName;
  $request['IndexField'] = indexField;
  final $result = await _protocol.send(
    $request,
    action: 'DefineIndexField',
    version: '2013-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DefineIndexFieldRequest'],
    shapes: shapes,
    resultWrapper: 'DefineIndexFieldResult',
  );
  return DefineIndexFieldResponse.fromXml($result);
}