defineSuggester method

Future<DefineSuggesterResponse> defineSuggester({
  1. required String domainName,
  2. required Suggester suggester,
})

Configures a suggester for a domain. A suggester enables you to display possible matches before users finish typing their queries. When you configure a suggester, you must specify the name of the text field you want to search for possible matches and a unique name for the suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.

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

Implementation

Future<DefineSuggesterResponse> defineSuggester({
  required String domainName,
  required Suggester suggester,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  ArgumentError.checkNotNull(suggester, 'suggester');
  final $request = <String, dynamic>{};
  $request['DomainName'] = domainName;
  $request['Suggester'] = suggester;
  final $result = await _protocol.send(
    $request,
    action: 'DefineSuggester',
    version: '2013-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DefineSuggesterRequest'],
    shapes: shapes,
    resultWrapper: 'DefineSuggesterResult',
  );
  return DefineSuggesterResponse.fromXml($result);
}