Fix StringIndexOutOfBoundsException in COMPLETION command when options are omitted.#138363
Merged
afoucret merged 5 commits intoelastic:mainfrom Nov 20, 2025
Merged
Conversation
…al parameters omitted
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Collaborator
|
Hi @afoucret, I've created a changelog YAML for you. |
afoucret
commented
Nov 20, 2025
| } | ||
|
|
||
| Map<String, Expression> optionsMap = visitCommandNamedParameters(ctx).keyFoldedMap(); | ||
| Map<String, Expression> optionsMap = optionsExpression.keyFoldedMap(); |
Contributor
Author
There was a problem hiding this comment.
ℹ️ For whatever reason (abuse of pizzas?) I was not reusing the optionExpression while it was the right things to do.
| // completely change the syntax in the future. | ||
| throw new ParsingException(source(ctx), "Missing mandatory option [{}] in COMPLETION", Completion.INFERENCE_ID_OPTION_NAME); | ||
| throw new ParsingException( | ||
| completion.source(), |
Contributor
Author
There was a problem hiding this comment.
ℹ️ Using completion.source instead of source(ctx). Avoid StringIndexOutOfBoundsException that were cause when options were missing (ctx is null)
afoucret
commented
Nov 20, 2025
afoucret
added a commit
to afoucret/elasticsearch
that referenced
this pull request
Nov 20, 2025
…s are omitted. (elastic#138363) Fix yaml
ncordon
pushed a commit
to ncordon/elasticsearch
that referenced
this pull request
Nov 26, 2025
…s are omitted. (elastic#138363) Fix yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #138361