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

[BUG] Built-in english analyzer not supported by type definitions #979

Open
amitbeck opened this issue Feb 20, 2025 · 0 comments
Open

[BUG] Built-in english analyzer not supported by type definitions #979

amitbeck opened this issue Feb 20, 2025 · 0 comments

Comments

@amitbeck
Copy link

amitbeck commented Feb 20, 2025

What is the bug?

The docs show an example of configuring an English analyzer like so:

{
  "settings": {
    "analysis": {
      "analyzer": {
        "english_analyzer": {
          "type": "english",
          // ...
        }
      }
    }
  }
}

But the type definitions don't seem to reflect that such valid is valid for type:

Type '"english"' is not assignable to type '"custom" | "fingerprint" | "keyword" | "language" | "nori" | "pattern" | "simple" | "standard" | "stop" | "whitespace" | "icu_analyzer" | "kuromoji" | "snowball" | "dutch" | "smartcn" | "cjk" | "phone" | "phone-search"'. ts(2322)
_common.analysis.d.ts(76, 3): The expected type comes from property 'type' which is declared here on type 'Analyzer'

How can one reproduce the bug?

import { type API } from "@opensearch-project/opensearch";

const indexConfig: API.Indices_Create_RequestBody = {
  settings: {
    analysis: {
      analyzer: {
        english_analyzer: {
          type: "english",
       // ~~~~ <- type error
          // ...
        },
      },
    },
  },
}

What is the expected behavior?

"english" should be a valid value for type in the Analyzer union type

What is your host/environment?

macOS 15.3.1
Node.js v22.14.0
TypeScript v5.7.2

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

@amitbeck amitbeck changed the title [BUG] english analyzer not supported by type definitions [BUG] Built-in english analyzer not supported by type definitions Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant