OpenSearch allows you to clear expired documents. In the OpenSearch console, you can manually clear application documents and expired documents. You can also enable automatic clearing for expired documents.
Note:
When you clear data or expired documents, reindexing is triggered.
Clearing documents means only clearing the expired documents that meet the specified conditions in the primary table of an application.
- By default, automatic document clearing starts at 00:00. After the clearing is completed, the newly generated application version automatically goes online.
Supported applications
Advanced applications
The document clearing feature is supported.
Standard applications
The document clearing feature is not supported.
Procedure
Log on to the OpenSearch console. On the Applications page, find the application whose expired documents you want to clear, click More in the Actions column, and then select Clear Documents. In the Clear Documents panel, click Clear Now or Auto Clearing.

Clear Now
Reserved Field: the reserved field, which must be of the
INT
type in the primary table. The value of this field is aUNIX
timestamp in seconds or milliseconds.Documents in Recent X Days: specifies that documents in recent X days need to be reversed. Valid values of X: 7 to 180.
Unit:
Seconds: a
UNIX
timestamp in seconds, which is usually a 10-digit integer.Milliseconds: a
UNIX
timestamp in milliseconds, which is usually a 13-digit integer. OpenSearch converts the value of a field of the DATETIME type in the data source to a UNIX timestamp in milliseconds.
Note
The reserved field must be of the INT type in the primary table.
Auto Clearing
Auto Clearing: specifies whether to enable automatic clearing for expired documents. By default, this feature is disabled.
Reserved Field: the reserved field, which must be of the
INT
type in the primary table. The value of this field is aUNIX
timestamp in seconds or milliseconds.Documents in Recent X Days: specifies that documents in recent X days need to be reversed. Valid values of X: 7 to 180.
Unit:
Seconds: a
UNIX
timestamp in seconds, which is usually a 10-digit integer.Milliseconds: a
UNIX
timestamp in milliseconds, which is usually a 13-digit integer. OpenSearch converts the value of a field of the DATETIME type in the data source to a UNIX timestamp in milliseconds.
Note:
If you enable the automatic clearing feature, OpenSearch automatically clears expired documents based on the selected field each day. If your documents are not frequently updated, we recommend that you disable this feature.