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: allow returning an empty response if ignore_unavailable is used for non-existent indices #106805

Open
astefan opened this issue Mar 27, 2024 · 2 comments
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@astefan
Copy link
Contributor

astefan commented Mar 27, 2024

Description

Following #106636 merge ESQL queries touching inexistent indices from nonexistent1, nonexistent2 options "ignore_unavailable"="true" will still return "index not found" error while the same ES query POST /localhost:9200/nonexistent1,nonexistent2/_search?ignore_unavailable=true will not return an error.

We should look into having the same behavior as the one of ES and _search endpoint.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@astefan
Copy link
Contributor Author

astefan commented Apr 3, 2024

ESQL uses IndexResolver.FIELD_CAPS_INDICES_OPTIONS that has some small differences from _search default indices options:

  • .concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ALLOW_UNAVAILABLE_TARGETS) meaning ignore_unavailable is true, while in SearchRequest the default is false
  • allowClosedIndices(true) while for _search is false
  • _search also has an extra .allowFailureIndices(true), which is newly added in 8.14. Failure indices seem to refer to: Add ability to create a data stream failure store #99134 (added in 8.12)

These differences mean that, when the option (ignore_unavailable or allow_no_indices) is not explicitly used (and the default takes precedence), then the behavior of ESQL differs from the one of _search. We either document these differences and make sure users are aware of them or we start using the _search default indices options and adapt EsqlIndexResolver to react accordingly to an empty _field_caps response.
Somewhat related: #107031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

2 participants