OpenSearch icon

OpenSearch

Consume the OpenSearch API

Actions9

Overview

This node integrates with the OpenSearch API to manage documents and indexes. Specifically, for the Document Delete operation, it deletes a document from a specified index in an OpenSearch cluster. This is useful when you want to remove outdated or irrelevant data from your search index.

Common scenarios include:

  • Removing user-generated content that has been deleted or flagged.
  • Cleaning up test or temporary documents after processing.
  • Managing document lifecycle by deleting expired entries.

Example: Deleting a product listing document from an e-commerce search index when the product is discontinued.

Properties

Name Meaning
Index ID The identifier of the index containing the document to delete.
Document ID The identifier of the specific document to delete within the given index.
Options Additional options for deletion:
   Bulk Delete Whether to perform the deletion as part of a bulk operation (true/false).

Output

The output JSON contains the response from the OpenSearch API regarding the deletion request. It typically includes metadata about the deletion status of the document.

  • If Bulk Delete is enabled, the output corresponds to the bulk API response for each document deletion.
  • If not using bulk, the output reflects the single document deletion result.

No binary data is produced by this operation.

Dependencies

  • Requires an active connection to an OpenSearch cluster.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests to the OpenSearch API.
  • Uses internal helper functions to send HTTP DELETE requests to the OpenSearch REST endpoints.

Troubleshooting

  • Error: Document not found — Occurs if the specified document ID does not exist in the given index. Verify the IDs are correct.
  • Error: Index not found — Happens if the index ID is invalid or the index was deleted. Confirm the index exists.
  • Bulk operation errors — When using bulk delete, partial failures may occur. The node reports which items failed. Use "Continue on Fail" option to handle these gracefully.
  • Authentication errors — Ensure the API key or credentials are valid and have sufficient permissions to delete documents.
  • Invalid JSON in options — If additional options are provided as JSON, ensure they are correctly formatted.

Links and References

Discussion