-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Completion suggestion should also consider text if prefix/regex is missing #23451
Merged
Conversation
This file contains 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
…efix/regex missing In cases where the user specifies only the `text` option on the top level suggest element (either via REST or the java api), this gets transferred to the `text` property in the SuggestionSearchContext. CompletionSuggestionContext currently requires prefix or regex to be specified, otherwise errors. We should use the global `text` property as a fall back if provided in this case. Closes to elastic#23340
@areek could you please take a look at this? |
areek
approved these changes
Mar 16, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cbuescher for catching the bug! LGTM :)
@areek thanks for the review |
cbuescher
added a commit
that referenced
this pull request
Mar 16, 2017
…efix/regex missing (#23451) In cases where the user specifies only the `text` option on the top level suggest element (either via REST or the java api), this gets transferred to the `text` property in the SuggestionSearchContext. CompletionSuggestionContext currently requires prefix or regex to be specified, otherwise errors. We should use the global `text` property as a fallback if neither prefix nor regex is provided. Closes to #23340
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Mar 17, 2017
* master: Clear the interrupt flag before joining Migrate to max line length of 100 Docs: Corrected path to elasticsearch-plugin (elastic#23622) Docs: Add comma to reverse nested agg snippet Fix third-party audit task for Gradle 3.4 (elastic#23612) Adapter action future should restore interrupts Update scripting.asciidoc Unmark reindex as experimental CompletionSuggestionContext#toQuery() should also consider text if prefix/regex missing (elastic#23451) Docs: Specify that byte units use powers of 1024 (elastic#23574) Remove Settings.settingsBuilder (elastic#23575) Change params._source to params['_source'] in example. Fix example in documentation for Painless using _source. (elastic#21322) Remove extra line from license header Fix num docs to be positive in bucket deferring collector test Mapping: Fix NPE with scaled floats stats when field is not indexed (elastic#23528)
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Mar 17, 2017
* single-node-discovery: Clear the interrupt flag before joining Migrate to max line length of 100 Docs: Corrected path to elasticsearch-plugin (elastic#23622) Docs: Add comma to reverse nested agg snippet Fix third-party audit task for Gradle 3.4 (elastic#23612) Adapter action future should restore interrupts Update scripting.asciidoc Unmark reindex as experimental CompletionSuggestionContext#toQuery() should also consider text if prefix/regex missing (elastic#23451) Docs: Specify that byte units use powers of 1024 (elastic#23574) Remove Settings.settingsBuilder (elastic#23575) Change params._source to params['_source'] in example. Fix example in documentation for Painless using _source. (elastic#21322) Remove extra line from license header Fix num docs to be positive in bucket deferring collector test Mapping: Fix NPE with scaled floats stats when field is not indexed (elastic#23528)
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Mar 17, 2017
* master: Clear the interrupt flag before joining Migrate to max line length of 100 Docs: Corrected path to elasticsearch-plugin (elastic#23622) Docs: Add comma to reverse nested agg snippet Fix third-party audit task for Gradle 3.4 (elastic#23612) Adapter action future should restore interrupts Update scripting.asciidoc Unmark reindex as experimental CompletionSuggestionContext#toQuery() should also consider text if prefix/regex missing (elastic#23451) Docs: Specify that byte units use powers of 1024 (elastic#23574) Remove Settings.settingsBuilder (elastic#23575)
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.
In cases where the user specifies only the
text
option on the top levelsuggest element (either via REST or the java api), this gets transferred to the
text
property in the SuggestionSearchContext. CompletionSuggestionContextcurrently requires prefix or regex to be specified, otherwise errors. We should
use the global
text
property as a fall back if provided in this case.Note that when
text
is set on the CompletionSuggestionBuilder directly, we alreadyoverwrite a missing
prefix
property inSuggestionBuilder#populateCommonFields
.This, however, currently doesn't work with the global text overwrite taking place in
SuggestBuilder#build
Closes to #23340