Skip to content

Allow 'wait_for' option for query param 'refresh' when using _reindex (as in the docs) #65031

@mariusbancos

Description

@mariusbancos

Elasticsearch version (bin/elasticsearch --version):
ES: 7.8.1

OS version (uname -a if on a Unix-like system):
Ubuntu 20.04 using docker for ES

Description of the problem including expected versus actual behavior:
Seems that when trying to _reindex from one index to another (same cluster) the option 'wait_for' for refresh query param is not allowed (as in the docs is saying "If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for. Default: false.")

Steps to reproduce:

POST _reindex?refresh=wait_for
{
  "source": {
    "index": "old_index",
  },
  "dest": {
    "index": "new_index"
  }
}

And the error it throws:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Failed to parse value [wait_for] as only [true] or [false] are allowed."
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Failed to parse value [wait_for] as only [true] or [false] are allowed."
  },
  "status" : 400
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed Indexing/ReindexIssues relating to reindex that are not caused by issues further down>bugTeam:Distributed (Obsolete)Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions