SpringDataElasticsearchDevs / spring-data-elasticsearch

Spring Data implementation for ElasticSearch
63 stars 26 forks source link

Support Geo Distance Sorting #14

Closed puug closed 11 years ago

puug commented 11 years ago

At the moment, only basic field name sort appears to be supported. Geo Distance Sorting would be nice, via the GeoDistanceSortBuilder class.

Unfortunately there doesn't appear to be a way to specify your own ElasticSearch sort, like you can with query & filter to get around this issue either.

http://www.elasticsearch.org/guide/reference/api/search/sort.html

mohsinh commented 11 years ago

Thanks for trying out !

Totally agreed with you that currently there is no support for GeoDistanceSortBuilder. As our target is to achieve basic functionality of elasticsearch as search and index(Mappings, Facets etc) then go for more advanced feature such as Sorting, Parent Child , Advanced Filters etc .

We will implement support for Sort using SortBuilder abstract class soon, hence we can have all sorting feature such as FieldSortBuilder, GeoDistanceSortBuilder, ScoreSortBuilder, ScriptSortBuilder etc.

puug commented 11 years ago

No worries. I've gone and added very basic elasticsearch SortBuilder support to my fork.

mohsinh commented 11 years ago

Yes i have seen that, and it looks legit :-)

mohsinh commented 11 years ago

Using your code have committed with b2272dc8d63116467084506f90d524caf7fbe437 Basic SortBuilder Support.

Many Thanks !