Looks good to me.
Sort sort = qb.sort().native(SortField).createSort();
Sort sort = qb.sort().native("{ \"sort\": [ \"_score\" ] }").createSort();
I'm wondering if you should wrap the native sort in an interface. With Elasticsearch, you pass a JSON String so you don't have a dependency on a ES class but we could imagine having a sort class specific to the backend. I like the ability to use .fromSpatialQuery(sq) if it does not add too much complexity - and of course if we keep the other syntaxes. |