Skip to content

elasticsearch update-by-query

Update documents that match the specified query

Description

Update documents that match the specified query

Synopsis

elasticsearch update-by-query
    [--site <site>]
    [--cluster <cluster>]
    --query <query>
    [<index>]
    [--async]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of elastic search cluster
     Example: --cluster "elastic-default"
     Default: elastic-default      Attributes: optional

query - (string)

     Query string you wish to parse and use for filtering. Defined using Lucene query string syntax.
     Example: --query "(new york city) OR (big apple)"
     Default: _None_      Attributes: required

index - (string)

     Indices to close
     Example: "students"
     Default: _None_      Attributes: optional, multiple allowed

async - (bool)

     Create a task instead of waiting for completion
     Example: --async
     Default: _None_      Attributes: optional

Examples

Input:

! elasticsearch update-by-query --query "user.id:kimchy"
Output:
{
  "took": 6,
  "timed_out": false,
  "total": 0,
  "updated": 0,
  "deleted": 0,
  "batches": 0,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1.0,
  "throttled_until_millis": 0,
  "failures": []
}

Access Control

To use this command, you need access to the following:

Field Value
Action
Service Type "elasticsearch"
Service Instance cluster
Namespace
Object Type
Object ID

Please see Access Control for details.