Skip to content

Commit

Permalink
Fix the "slices" parameter for the Delete By Query API in the REST sp…
Browse files Browse the repository at this point in the history
…ecification

This patch updates the `type` parameter in the Delete By Query API: according to
[the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html#docs-delete-by-query-slice), it can be set to "auto",
but the type in the documentation allows only numerical values.

This prevents people from setting the parameter to "auto" eg. in the Go client,
which generates source from the specification, and sets the corresponding Go
type as number.

The patch uses the `|` notation, which we have discussed previously for encoding
a "polymorphic" parameter like this.

Related: elastic/go-elasticsearch#77
  • Loading branch information
karmi committed Jan 28, 2020
1 parent 3e9eb58 commit 8a7023c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@
"description":"The throttle for this request in sub-requests per second. -1 means no throttle."
},
"slices":{
"type":"number",
"type":"number|auto",
"default":1,
"description":"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks."
"description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks."
}
},
"body":{
Expand Down

0 comments on commit 8a7023c

Please sign in to comment.