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 Answer
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

profile pictureAWS
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • @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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions