Where is the API going The most likely scenario is that QueryBuilder will be made generic in 6 to output:
- Lucene Query or Elasticsearch JSON when createQuery is called
- Lucene Sort or Elasticsearch JSON when createSort is called
- be byNative(SortField) for Lucene and byNative(String) for ES
It's not rebuilt from the ground up, just generified to meet our needs. We did explore in Rome something that integrate the DSL and the createQuery but it was not destroying the DSL, just adding more leaves options if I recall. Spatial Ok Nicolas Helleringer, let's keep withComputeMethod for later just making usre the DSL could be expanded. On byDistanceFromSpatialQuery(Query) I'm fine with dropping it. Native I still feel native should be in with a oveloaded method byNative(SortField) and byNative(String), the former only usable with Lucene, the latter only with Elasticsearch. Yes using a custom SortField to keep the JSON string payload seems fine to me for the time being. In 6, we will be able to introduce a generic type bedending ont he backend targeted. So yes it looks hacky but that's temporary. Make it experimental if you have concerns. Do we want to support sorting on unmapped fields Doesn't native gives us a way out? Anyways, I'm fine with restricting for now. |