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.
The document clearing feature clears only the expired documents that meet the specified conditions in the primary table of an application.
When both online and offline applications exist, you must delete offline applications before you can clear data.
Clear Now is the immediate execution of Auto Clearing. When a Clear Now task starts, an offline application is generated to clean expired documents that meet the conditions in the primary table. After the clearing is complete, the offline application automatically goes online.
By default, Auto Clearing starts at 00:00. When the clearing task starts, an offline application is generated to clean expired documents that meet the conditions in the primary table. After the clearing is complete, the offline application automatically goes online.
Procedure
Log on to the OpenSearch console. On the Instance Management page, find the application whose expired documents you want to clear, click the More icon 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 Enabled: 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 auto 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.