-
Notifications
You must be signed in to change notification settings - Fork 25.2k
ESQL: Search results for wildcards and selectors return errors instead of empty results when indices are missing #125995
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
Comments
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Thanks @jbaiera . I think we've discussed this in the team before and pondered whether this inconsistency with If no index matches the I agree, however, that the error message is misleading for |
Hmm, that is indeed a tricky problem to solve. If there were no Granted, an empty wildcard means no schema would be returned in the response either. Is the lack of any column list in the final result a problem? |
An empty column list can work, although we have identified issues with our current approach that give rise to bugs in edge cases that we haven't solved yet. In general, an empty column list will be treated as if the whole result was empty - meaning, no rows either. This can be seen when intentionally dropping all columns: That said, I think we should be able to return an empty result for Or can the schema of the failure store maybe be known even when it doesn't exist yet? |
Technically the failure store schema is controlled by Elasticsearch, so it's possible that we could render a schema even for the failure indices that do not exist yet. This rendered schema would need to be only used if the failure store has no backing indices in it. Users can add arbitrary indices to the failure store for operational reasons, so we make no guarantees about the shape or collection of mappings in the failure store when reading it. We only ensure that we write failure store data to indices that Elasticsearch creates itself. |
If you search for an index using a wildcard pattern, and the pattern does not match any indices, you will receive a successful response with no results from the
_search
API, but an error from the_query
API:This can also be seen when searching a data stream's failure store if the failure store does not exist yet (e.g. there have been no failures logged yet).
Executing the query operation with error tracing enabled on the latest mainline version reveals the following stack traces:
The text was updated successfully, but these errors were encountered: