- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
IndexDocumentsCommand
Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose OptionStatus is RequiresIndexDocuments
.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudSearchClient, IndexDocumentsCommand } from "@aws-sdk/client-cloudsearch"; // ES Modules import
// const { CloudSearchClient, IndexDocumentsCommand } = require("@aws-sdk/client-cloudsearch"); // CommonJS import
const client = new CloudSearchClient(config);
const input = { // IndexDocumentsRequest
DomainName: "STRING_VALUE", // required
};
const command = new IndexDocumentsCommand(input);
const response = await client.send(command);
// { // IndexDocumentsResponse
// FieldNames: [ // FieldNameList
// "STRING_VALUE",
// ],
// };
IndexDocumentsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DomainName Required | string | undefined | A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen). |
IndexDocumentsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
FieldNames | string[] | undefined | The names of the fields that are currently being indexed. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BaseException | client | An error occurred while processing the request. |
InternalException | server | An internal error occurred while processing the request. If this problem persists, report an issue from the Service Health Dashboard . |
ResourceNotFoundException | client | The request was rejected because it attempted to reference a resource that does not exist. |
ValidationException | client | The request was rejected because it has invalid parameters. |
CloudSearchServiceException | Base exception class for all service exceptions from CloudSearch service. |