Direkt zum Inhalt

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

EXPERTE

beantwortet vor 2 Jahren

EXPERTE

überprüft vor 2 Jahren

EXPERTE

überprüft vor 2 Jahren

  • @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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.