Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Delete By Query "slices" field cannot be set to "auto" #77

Closed
rliebz opened this issue Aug 6, 2019 · 7 comments
Closed

The Delete By Query "slices" field cannot be set to "auto" #77

rliebz opened this issue Aug 6, 2019 · 7 comments

Comments

@rliebz
Copy link

rliebz commented Aug 6, 2019

Based on the Delete By Query API documentation, the slices field may be set to auto.

The DeleteByQueryRequest struct only allows *int as input, as does the DeleteByQuery method, so there does not currently appear to be a way to set that value using this library.

@karmi
Copy link
Contributor

karmi commented Aug 7, 2019

Hi, it seems like the REST API specification for this API lists the parameter as number, and that's being picked up by the generator. It's worth opening an issue against the specification...

@karmi
Copy link
Contributor

karmi commented Nov 6, 2019

Hi @rliebz, it looks like the spec hasn't been updated yet. I'll have a look into that.

@Ice3man543
Copy link

Hey @karmi, any updates on this issue? I also came across this issue in my use case. This seems like a much needed fix.

@karmi
Copy link
Contributor

karmi commented Jan 28, 2020

Hi, sorry, not news yet — I'll prioritize it for the next month.

karmi added a commit to elastic/elasticsearch that referenced this issue Jan 28, 2020
…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
karmi added a commit to elastic/elasticsearch that referenced this issue Feb 2, 2020
…ecification (#51535)

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
karmi added a commit to elastic/elasticsearch that referenced this issue Feb 2, 2020
…ecification (#51535)

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
karmi added a commit to elastic/elasticsearch that referenced this issue Feb 2, 2020
* REST: Test: Fix the `accept_enterprise` parameter for Get License API (#51527)

The Get License API specifies the `accept_enterprise` parameter as a `boolean`:

https://github.com/elastic/elasticsearch/blob/0ca5cb8cb636a4be9c36b8e38e565af66abc423b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json#L22-L27

In the test, a `string` is passed however, which makes the test compilation fail in the Go client.

(cherry picked from commit e2a2169)

* Fix the SQL API documentation in REST specification (#51534)

This patch fixes the SQL REST API documentation to conform to the current schema.

(cherry picked from commit c8b6a84)

* Fix the "slices" parameter for the Delete By Query API in the REST specification (#51535)

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

* Fix the Enrich API documentation in REST specification (#51528)

This patch fixes the REST API documentation for the Enrich APIs to conform to the current schema.

(cherry picked from commit 59f28f4)
@karmi
Copy link
Contributor

karmi commented Feb 13, 2020

Hello, this has been fixed in the REST API specification, and the field is takes "polymorphic" values on master:

I'll have a look into backporting this into 7.x.

@daidi
Copy link

daidi commented Apr 15, 2020

rely on this config too , in version 6.x

@technige
Copy link

Closing as this has now been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants