updateFeaturedResultsSet method

Future<UpdateFeaturedResultsSetResponse> updateFeaturedResultsSet({
  1. required String featuredResultsSetId,
  2. required String indexId,
  3. String? description,
  4. List<FeaturedDocument>? featuredDocuments,
  5. String? featuredResultsSetName,
  6. List<String>? queryTexts,
  7. FeaturedResultsSetStatus? status,
})

Updates a set of featured results. Features results are placed above all other results for certain queries. You map specific queries to specific documents for featuring in the results. If a query contains an exact match of a query, then one or more specific documents are featured in the search results.

May throw AccessDeniedException. May throw FeaturedResultsConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter featuredResultsSetId : The identifier of the set of featured results that you want to update.

Parameter indexId : The identifier of the index used for featuring results.

Parameter description : A new description for the set of featured results.

Parameter featuredDocuments : A list of document IDs for the documents you want to feature at the top of the search results page. For more information on the list of featured documents, see FeaturedResultsSet.

Parameter featuredResultsSetName : A new name for the set of featured results.

Parameter queryTexts : A list of queries for featuring results. For more information on the list of queries, see FeaturedResultsSet.

Parameter status : You can set the status to ACTIVE or INACTIVE. When the value is ACTIVE, featured results are ready for use. You can still configure your settings before setting the status to ACTIVE. The queries you specify for featured results must be unique per featured results set for each index, whether the status is ACTIVE or INACTIVE.

Implementation

Future<UpdateFeaturedResultsSetResponse> updateFeaturedResultsSet({
  required String featuredResultsSetId,
  required String indexId,
  String? description,
  List<FeaturedDocument>? featuredDocuments,
  String? featuredResultsSetName,
  List<String>? queryTexts,
  FeaturedResultsSetStatus? status,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.UpdateFeaturedResultsSet'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FeaturedResultsSetId': featuredResultsSetId,
      'IndexId': indexId,
      if (description != null) 'Description': description,
      if (featuredDocuments != null) 'FeaturedDocuments': featuredDocuments,
      if (featuredResultsSetName != null)
        'FeaturedResultsSetName': featuredResultsSetName,
      if (queryTexts != null) 'QueryTexts': queryTexts,
      if (status != null) 'Status': status.value,
    },
  );

  return UpdateFeaturedResultsSetResponse.fromJson(jsonResponse.body);
}