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

Clean up handling of missing values when merging shard results on the coordinating node. #12127

Merged
merged 1 commit into from Jul 9, 2015

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Jul 8, 2015

Today shards are responsible for producing one sort value per document, which
is later used on the coordinating node to resolve the global top documents.
However, this is problematic on string fields with
missing: _first, order: desc or missing: _last, order: asc given that there
is no such thing as a string that compares greater than any other string. Today
we use a string containing a single code point which is the maximum allowed code
point but this is a hack: instead we should inform the coordinating node that
the document had no value and let it figure out how it should be sorted
depending on whether missing values should be sorted first or last.

Close #9155

… coordinating node.

Today shards are responsible for producing one sort value per document, which
is later used on the coordinating node to resolve the global top documents.
However, this is problematic on string fields with
`missing: _first, order: desc` or `missing: _last, order: asc` given that there
is no such thing as a string that compares greater than any other string. Today
we use a string containing a single code point which is the maximum allowed code
point but this is a hack: instead we should inform the coordinating node that
the document had no value and let it figure out how it should be sorted
depending on whether missing values should be sorted first or last.

Close elastic#9155
@jpountz jpountz added v2.0.0-beta1 review :Search/Search Search-related issues that do not fall into other categories labels Jul 8, 2015
@rjernst
Copy link
Member

rjernst commented Jul 8, 2015

LGTM

jpountz added a commit that referenced this pull request Jul 9, 2015
Clean up handling of missing values when merging shard results on the coordinating node.
@jpountz jpountz merged commit f82b5ce into elastic:master Jul 9, 2015
@kevinkluge kevinkluge removed the review label Jul 9, 2015
@jpountz jpountz deleted the fix/sort_merge branch July 9, 2015 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search: Fix merging of the shard results to use field comparators
4 participants