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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect TypeScript typings for function_score #2255

Open
arslivinski opened this issue May 9, 2024 · 1 comment
Open

Incorrect TypeScript typings for function_score #2255

arslivinski opened this issue May 9, 2024 · 1 comment

Comments

@arslivinski
Copy link

馃悰 Bug Report

According to the documentation, I should be able to pass a random_score to a function_score. However, the TypeScript type appears to be wrong, not allowing this property.

Note that I'm using this package for the typings only.

To Reproduce

The following code

import type { estypes } from "@elastic/elasticsearch";

export const request: estypes.SearchRequest = {
  query: {
    function_score: {
      random_score: {
        seed: 10,
        field: "_seq_no",
      },
    },
  },
};

Results in this error

Object literal may only specify known properties, and 'random_score' does not exist in type 'QueryDslFunctionScoreQuery'.

Playground

Expected behavior

No error.

Your Environment

  • node version: 18.20.0
  • @elastic/elasticsearch version: >=8.12.2
  • os: Ubuntu 22.04.4
@JoshMock
Copy link
Member

Duplicate of elastic/elasticsearch-specification#2109, but I'll keep it open here so you get notified when that gets fixed. It's been sitting for a bit, but hopefully I can circle back to it soon. 馃檭

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

2 participants