내용으로 건너뛰기

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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠