Ir para o conteúdo

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

ESPECIALISTA

respondido há 2 anos

ESPECIALISTA

avaliado há 2 anos

ESPECIALISTA

avaliado há 2 anos

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

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.