DeleteByQueryElasticsearch 2025.10.9.21

Bundle

org.apache.nifi | nifi-elasticsearch-restapi-nar

Description

Delete from an Elasticsearch index using a query. The query can be loaded from a flowfile body or from the Query parameter.

Tags

delete, elastic, elasticsearch, elasticsearch7, elasticsearch8, elasticsearch9, query

Input Requirement

ALLOWED

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
Client ServiceAn Elasticsearch client service to use for running queries.
IndexThe name of the index to use.
Max JSON Field String LengthThe maximum allowed length of a string value when parsing a JSON document or attribute.
QueryA query in JSON syntax, not Lucene syntax. Ex: {“query”:{“match”:{“somefield”:”somevalue”}}}. If this parameter is not set, the query will be read from the flowfile content. If the query (property and flowfile content) is empty, a default empty JSON Object will be used, which will result in a “match_all” query in Elasticsearch.
Query AttributeIf set, the executed query will be set on each result flowfile in the specified attribute.
Query ClauseA “query” clause in JSON syntax, not Lucene syntax. Ex: {“match”:{“somefield”:”somevalue”}}. If the query is empty, a default JSON Object will be used, which will result in a “match_all” query in Elasticsearch.
Query Definition StyleHow the JSON Query will be defined for use by the processor.
TypeThe type of this document (used by Elasticsearch for indexing and searching).

Relationships

NameDescription
failureIf the “by query” operation fails, and a flowfile was read, it will be sent to this relationship.
retryAll flowfiles that fail due to server/cluster availability go to this relationship.
successIf the “by query” operation succeeds, and a flowfile was read, it will be sent to this relationship.

Writes attributes

NameDescription
elasticsearch.delete.tookThe amount of time that it took to complete the delete operation in ms.
elasticsearch.delete.errorThe error message provided by Elasticsearch if there is an error running the delete.