Skip to content

Document "require_alias" in _bulk API  #66255

@jakelandis

Description

@jakelandis

#58917 introduced require_alias for index operations. Included in this the _bulk API both by line item and by query parameter. However, it looks like the documentation was missed.

For example:


POST _bulk
{ "create" : { "_index" : "test_alias", "require_alias" : true } }
{ "@timestamp" : "1" }

and

POST _bulk?require_alias=true
{ "create" : { "_index" : "test_alias" } }
{ "@timestamp" : "1" }

Will correctly fail with

{
  "took" : 0,
  "errors" : true,
  "items" : [
    {
      "create" : {
        "_index" : "test_alias",
        "_type" : "_doc",
        "_id" : null,
        "status" : 404,
        "error" : {
          "type" : "index_not_found_exception",
          "reason" : "no such index [test_alias] and [require_alias] request flag is [true] and [test_alias] is not an alias",
          "index_uuid" : "_na_",
          "index" : "test_alias"
        }
      }
    }
  ]
}

since there is not an alias named "test_alias". We should document this new flag.

Metadata

Metadata

Assignees

Labels

>docsGeneral docs changesTeam:DocsMeta label for docs team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions