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.
We could do that but I think that should tie with the generification of the DSL to support different backend outputs (namely Lucene, ES and Solr. But that one can only happen in 6. |