UpdateByQueryElasticsearch 2.0.0

Bundle
org.apache.nifi | nifi-elasticsearch-restapi-nar
Description
Update documents in an Elasticsearch index using a query. The query can be loaded from a flowfile body or from the Query parameter. The loaded Query can contain any JSON accepted by Elasticsearch's _update_by_query API, for example a "query" object to identify what documents are to be updated, plus a "script" to define the updates to perform.
Tags
elastic, elasticsearch, elasticsearch5, elasticsearch6, elasticsearch7, elasticsearch8, query, update
Input Requirement
ALLOWED
Supports Sensitive Dynamic Properties
false
  • Additional Details for UpdateByQueryElasticsearch 2.0.0

    UpdateByQueryElasticsearch

    This processor executes an update operation against one or more indices using the _update_by_query handler. The query should be a valid Elasticsearch JSON DSL query (Lucene syntax is not supported). An optional Elasticsearch script can be specified to execute against the matched documents. An example query with script:

    {
      "script": {
        "source": "ctx._source.count++",
        "lang": "painless"
      },
      "query": {
        "match": {
          "username.keyword": "john.smith"
        }
      }
    }
    

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

    {
      "query": {
        "match_all": {}
      }
    }
    
Properties
Dynamic Properties
Relationships
Name Description
success If the "by query" operation succeeds, and a flowfile was read, it will be sent to this relationship.
failure If the "by query" operation fails, and a flowfile was read, it will be sent to this relationship.
retry All flowfiles that fail due to server/cluster availability go to this relationship.
Writes Attributes
Name Description
elasticsearch.update.took The amount of time that it took to complete the update operation in ms.
elasticsearch.update.error The error message provided by Elasticsearch if there is an error running the update.