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.
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:
|DEFER||Content 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_FOR||The API call or method will not return from the content check process until the content has been indexed by Elasticsearch.|
|FORCE||Forces 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.