跳至内容

Delete Documents in a AWS Serverless Opensearch Collection Index

0

Hi, I am using the AWS Serverless OpenSearch Collection Index. My index is error-logs. I am trying to delete documents older than 3 days, for example.

I did not find an API that can delete the documents in the index for the AWS Serverless Opensearch Collection related index.

Anticipating a quick replay. Thank you.

  • Hi just realized the following from the document:- Only time series collections support data lifecycle policies. They are not supported by search or vector search collections. I am using search index type. So lifecycle rule doesn't work here. Is there an alternative?

1 回答
1

Hi,

  1. You have full examples of lifecycle rules in AWS public documentation: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-policies

  2. Why don't you use the OpenSearch delete document API ? See https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/

If you don't want to use REST but a specific SDK, the list is there: https://opensearch.org/docs/latest/clients

Best,

Didier

专家

已回答 2 年前

专家

已审核 2 年前

专家

已审核 2 年前

  • @Didier Durand, thanks for the answer. Nevertheless none of the API's shows me a way how to delete a document 30d back or 90d back. Can you give a specific query at least. I am using AWS Serverless Collection index.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。