Description and usage of DeleteByQueryElasticsearch processor:

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

Tags:

elastic, elasticsearch, delete, query

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the Expression Language Guide.

Name

Default Value

Allowable Values

Description

Query A 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.

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Query Attribute If set, the executed query will be set on each result flowfile in the specified attribute.

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Index

The name of the index to use.

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Type The type of this document (used by Elasticsearch for indexing and searching)

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Client Service

Controller Service API: 


ElasticSearchClientService

Implementation: 

ElasticSearchClientServiceImpl


An ElasticSearch client service to use for running queries.

Relationships:

Name

Description

success If the delete by query succeeds, and a flowfile was read, it will be sent to this relationship.
failure If the delete by query fails, and a flowfile was read, it will be sent to this relationship.

Reads Attributes:

None specified.

Writes Attributes:

Name

Description

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

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.

Summary:

This processor executes a delete operation against one or more indices using the _delete_by_query handler. The query should be a valid ElasticSearch JSON DSL query (Lucene syntax is not supported). An example query:

{
    "query": {
         "match": {
             "username.keyword": "john.smith"
        }
    }
}

To delete all of the contents of an index, this could be used:

{
    "query": {
       "match_all": {}
    }
}