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

Allow sorting when index is missing sort field #4061

Merged
merged 3 commits into from
Jun 2, 2015

Conversation

rashidkpc
Copy link
Contributor

This fixes #3125 and allows for sorting on a field even when it doesn't exist in an index. This manifests itself primarily in timestamped index patterns in which the field may not be present in all indices.

All indices in which the field is missing are instructed to treat the field as if it exists and is of type boolean. The effect is that the value will end up being null for missing fields.

In addition, this removes getNormalizedSort as it wasn't used anywhere.

@lukasolson
Copy link
Member

So I'm not exactly sure what's happening here, but it looks like the sorting is behaving funkily:

image

If you look at the response inside the spy panel, you'll see it's coming back in a different order, so I'm not sure why this is happening.

@rashidkpc
Copy link
Contributor Author

That shouldn't be related to this change. Maybe something broken in the resort of the segmented fetch?

@lukasolson
Copy link
Member

LGTM.

lukasolson added a commit that referenced this pull request Jun 2, 2015
Allow sorting when index is missing sort field
@lukasolson lukasolson merged commit 2c8e031 into elastic:master Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error sorting optional field
2 participants