updateByQueryedit

client.updateByQuery([params, [callback]])

Check the API Conventions and the elasticsearch docs for more information pertaining to this method.

Params

analyzer

String — The analyzer to use for the query string

analyzeWildcard

Boolean — Specify whether wildcard and prefix queries should be analyzed (default: false)

[defaultOperator=OR]

String — The default operator for query string query (AND or OR)

Options
  • "AND"
  • "OR"

df

String — The field to use as default where no field prefix is given in the query string

from

Number — Starting offset (default: 0)

ignoreUnavailable

Boolean — Whether specified concrete indices should be ignored when unavailable (missing or closed)

allowNoIndices

Boolean — Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

[conflicts=abort]

String — What to do when the update by query hits version conflicts?

Options
  • "abort"
  • "proceed"

[expandWildcards=open]

String — Whether to expand wildcard expression to concrete indices that are open, closed or both.

Options
  • "open"
  • "closed"
  • "none"
  • "all"

lenient

Boolean — Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

pipeline

String — Ingest pipeline to set on index requests made by this action. (default: none)

preference

String — Specify the node or shard the operation should be performed on (default: random)

q

String — Query in the Lucene query string syntax

routing

String, String[], Boolean — A comma-separated list of specific routing values

scroll

DurationString — Specify how long a consistent view of the index should be maintained for scrolled search

searchType

String — Search operation type

Options
  • "query_then_fetch"
  • "dfs_query_then_fetch"

searchTimeout

DurationString — Explicit timeout for each search request. Defaults to no timeout.

size

Number — Deprecated, please use max_docs instead

maxDocs

Number — Maximum number of documents to process (default: all documents)

sort

String, String[], Boolean — A comma-separated list of <field>:<direction> pairs

_source

String, String[], Boolean — True or false to return the _source field or not, or a list of fields to return

_sourceExcludes

String, String[], Boolean — A list of fields to exclude from the returned _source field

_sourceIncludes

String, String[], Boolean — A list of fields to extract and return from the _source field

terminateAfter

Number — The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

stats

String, String[], Boolean — Specific tag of the request for logging and statistical purposes

version

Boolean — Specify whether to return document version as part of a hit

versionType

Boolean — Should the document increment the version number (internal) on hit or not (reindex)

requestCache

Boolean — Specify if request cache should be used for this request or not, defaults to index level setting

refresh

Boolean — Should the effected indexes be refreshed?

[timeout=1m]

DurationString — Time each individual bulk request should wait for shards that are unavailable.

waitForActiveShards

String — Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

scrollSize

Number — Size on the scroll request powering the update by query

[waitForCompletion=true]

Boolean — Should the request should block until the update by query operation is complete.

requestsPerSecond

Number — The throttle to set on this request in sub-requests per second. -1 means no throttle.

[slices=1]

Number — The number of slices this task should be divided into. Defaults to 1 meaning the task isn’t sliced into subtasks.

index

String, String[], Boolean — A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices

type

String, String[], Boolean — A comma-separated list of document types to search; leave empty to perform the operation on all types

body

Object, JSON — An optional request body, as either JSON or a JSON serializable object. See the elasticsearch docs for details about what can be specified here.

back to top