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

Don't allow sorting on geo_point #1940

Merged
merged 2 commits into from
Nov 19, 2014
Merged

Conversation

lukasolson
Copy link
Member

In discover, if you add a field of type geo_point to your search, and then try to sort on that field, the app errors out. It doesn't make sense to allow sorting on geo_point as this is not supported by ElasticSearch. Perhaps in the future we can allow sorting geo_point fields by distance from a specified location.

Closes #1933.

In discover, if you add a field of type geo_point to your search, and then try to sort on that field, the app errors out. It doesn't make sense to allow sorting on geo_point as this is not supported by ElasticSearch. Perhaps in the future we can allow sorting geo_point by distance from a given location.
@@ -14,9 +14,13 @@ define(function (require) {
},
template: headerHtml,
controller: function ($scope) {
var sortableField = function (field) {
var mapping = $scope.mapping[field];
return mapping && mapping.indexed && mapping.type !== 'geo_point';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we changed mapping.type !== 'geo_point' to !_.contains(unsortableTypes, mapping.type) and then add a variable above with an array of the un-sortable types... then we can add more later.

@simianhacker
Copy link
Member

With changes... LGTM

@rashidkpc rashidkpc removed the review label Nov 19, 2014
@rashidkpc rashidkpc assigned lukasolson and unassigned simianhacker Nov 19, 2014
lukasolson added a commit that referenced this pull request Nov 19, 2014
Don't allow sorting on unsortable field types
@lukasolson lukasolson merged commit bb906f0 into elastic:master Nov 19, 2014
@lukasolson lukasolson deleted the issue-1933 branch November 21, 2014 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when sorting on geo_point
3 participants