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

Fix suggestions for empty indices #42927

Merged
merged 2 commits into from Jun 12, 2019

Conversation

@cbuescher
Copy link
Member

commented Jun 6, 2019

Currently suggesters return null values on empty shards. Usually this gets replaced
by results from other non-epmty shards, but if the index is completely epmty (e.g. after
creation) the search responses "suggest" is also "null" and we don't render a corresponding
output in the REST response. This is an irritating edge case that requires special handling on
the user side (see #42473) and should be fixed.

This change makes sure every suggester type (completion, terms, phrase) returns at least an
empty skeleton suggestion output, even for empty shards. This way, even if we don't find
any suggestions anywhere, we still return and output the empty suggestion.

Closes #42473

@elasticmachine

This comment has been minimized.

Copy link
Collaborator

commented Jun 6, 2019

@cbuescher cbuescher changed the title Fix emtpy suggestions for empty indices Fix suggestions for empty indices Jun 6, 2019
@cbuescher cbuescher force-pushed the cbuescher:fix-42473 branch from dca539b to fbdeb9f Jun 6, 2019
@cbuescher cbuescher force-pushed the cbuescher:fix-42473 branch from fbdeb9f to d92addc Jun 11, 2019
@cbuescher

This comment has been minimized.

Copy link
Member Author

commented Jun 11, 2019

@javanna thanks for the review, fixed the typo

Currently suggesters return null values on empty shards. Usually this gets replaced
by results from other non-epmty shards, but if the index is completely epmty (e.g. after
creation) the search responses "suggest" is also "null" and we don't render a corresponding
output in the REST response. This is an irritating edge case that requires special handling on
the user side (see #42473) and should be fixed.

This change makes sure every suggester type (completion, terms, phrase) returns at least an
empty skeleton suggestion output, even for empty shards. This way, even if we don't find
any suggestions anywhere, we still return and output the empty suggestion.

Closes #42473
@cbuescher cbuescher force-pushed the cbuescher:fix-42473 branch from d92addc to cfe1053 Jun 11, 2019
Copy link
Member

left a comment

LGTM

@cbuescher cbuescher merged commit 508496e into elastic:master Jun 12, 2019
8 checks passed
8 checks passed
CLA All commits in pull request signed
Details
elasticsearch-ci/1 Build finished.
Details
elasticsearch-ci/2 Build finished.
Details
elasticsearch-ci/bwc Build finished.
Details
elasticsearch-ci/default-distro Build finished.
Details
elasticsearch-ci/docbldesx Build finished.
Details
elasticsearch-ci/oss-distro-docs Build finished.
Details
elasticsearch-ci/packaging-sample Build finished.
Details
cbuescher added a commit that referenced this pull request Jun 12, 2019
Currently suggesters return null values on empty shards. Usually this gets replaced
by results from other non-epmty shards, but if the index is completely epmty (e.g. after
creation) the search responses "suggest" is also "null" and we don't render a corresponding
output in the REST response. This is an irritating edge case that requires special handling on
the user side (see #42473) and should be fixed.

This change makes sure every suggester type (completion, terms, phrase) returns at least an
empty skeleton suggestion output, even for empty shards. This way, even if we don't find
any suggestions anywhere, we still return and output the empty suggestion.

Closes #42473
@cbuescher

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

@javanna thanks for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.