REST API Index Policy documentation for the dotCMS Content Management System

When saving content via the java ContentletAPI or a REST endpoint, you can specify an indexPolicy, which allows you to control when the changes made by the API call will take place.

/api/v1/workflow/actions/b9d89c803d/fire?identifier=b105eddc-e4b0-4a7f-85ad-b09d29a1c31b?indexPolicy=WAIT_FOR

Specifying the index policy allows you to ensure that content changes made by one API call or method have completed, and the content is available, before subsequent API calls or methods which depend on the first changes.

Index Policy Values

There are 3 possible values for the index policy:

ValueDescription
DEFERContent will be indexed asynchronously, outside of the content check process. This means that valid content will finish the check in process and be returned via the APIs before the content is visible in the index.
This is the default index policy.
WAIT_FORThe API call or method will not return from the content check process until the content has been indexed by Elasticsearch.
FORCEForces Elasticsearch to index the content immediately.
Important: Using this value may cause system performance issues, and should only be used for testing purposes.

These values correspond to Elasticsearch’s “refresh” index policies. For more information, please see the Elasticsearch documentation.