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

[ESQL] Version is a required field #2247

Closed
cauemarcondes opened this issue May 6, 2024 · 3 comments
Closed

[ESQL] Version is a required field #2247

cauemarcondes opened this issue May 6, 2024 · 3 comments

Comments

@cauemarcondes
Copy link

cauemarcondes commented May 6, 2024

On this PR the ESQL _query api was changed making the version property required.

Currently, if I call the esql query I got back this error message:

{
  name: 'ResponseError',
  message: 'action_request_validation_exception\n' +
    '\tRoot causes:\n' +
    '\t\taction_request_validation_exception: Validation Failed: 1: [version] is required, latest available version is [2024.04.01];'
}

How does the query look like now?

POST _query
{
  "query": """
  FROM my-index*
  """,
  "version": "2024.04.01"
}

We should change the src/api/api/esql.ts file to accept a version in the API.

@stratoula
Copy link

There are 2 ways to run the _query in kibana atm:

  1. Use the async search strategy https://github.com/elastic/kibana/blob/main/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts. One example of the usage here
  2. The other is using the es client like that

@JoshMock
Copy link
Member

JoshMock commented May 6, 2024

There's an open conversation about how to handle this in each client. I'm planning to resolve how to best handle this for the JS client very soon.

@JoshMock JoshMock self-assigned this May 6, 2024
@JoshMock
Copy link
Member

JoshMock commented May 9, 2024

A default version is now injected if one is not provided. This fix has been merged to main and 8.14 branches, so it will be available when 8.14.0 ships.

@JoshMock JoshMock closed this as completed May 9, 2024
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

3 participants