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

refresh_interval cannot be set to null (= let ES reset the value to the default) #2014

Closed
tomsquest opened this issue Sep 20, 2023 · 4 comments
Assignees

Comments

@tomsquest
Copy link

tomsquest commented Sep 20, 2023

🐛 Bug Report

Typescript issue.

It is not possible to set a refresh_interval to null using the typescript client.

null is allowed in Elastic to reset the value of a setting to its default.

To Reproduce

Steps to reproduce the behavior:

  await elastic.indices.putSettings({
    index: indexName,
    settings: {
      refresh_interval: null, // <---- Error: IndicesIndexSettingsKeys.refresh_interval?: Duration | undefined
    },
  });

Expected behavior

putSettings should accept a refresh_interval of null.

export interface IndicesIndexSettingsKeys {
   // ...lines skipped...

    refresh_interval?: Duration | null; /// <---- proposal

Your Environment

  • node version: 18
  • @elastic/elasticsearch: 8.0
  • os: Linux
  • Typescript: 5.2.2
@bijela-gora
Copy link

bijela-gora commented Sep 20, 2023

Agree. It should be allowed to assign null. Link to documentation: https://www.elastic.co/guide/en/elasticsearch/reference/8.10/indices-update-settings.html#reset-index-setting

It's one more opened issue with TS types. One from me: #2013

@JoshMock
Copy link
Member

Yep, this does look like another TypeScript bug. I'll check the elasticsearch-specificaton soon to see if we can resolve it there. I've had to divert my focus away from this client for the last couple of months, but should be able to address several of the open issues soon.

In the meantime, you can use ignore instructions to skip over this bug and any others like it.

Thanks for the report!

@JoshMock JoshMock self-assigned this Sep 21, 2023
@tomsquest
Copy link
Author

Hi @JoshMock , I found the issue of the same kind
elastic/elasticsearch-specification#2274

You can close it here, or keep it for reference. No problem.

@JoshMock
Copy link
Member

Closing as duplicate since a spec issue already exists.

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

3 participants