I'm using Spring Data Elasticsearch 4.2.3
and I build my Query using Criteria in the following way:
Criteria criteria = ...
Query query = new CriteriaQuery(criteria)
.setPageable(paging);
SearchHits<Content> hits = elasticsearchRestTemplate
.search(query, Person.class);
I want to add DistanceFeatureQueryBuilder
to the query before searching. I can create it in this way but don't know how to add it to the query:
DistanceFeatureQueryBuilder distanceFeatureQueryBuilder = new DistanceFeatureQueryBuilder("date",
new Origin("now"), "1d");
How can I use both at the same time? I want to use Criteria to build the conditions and use distance_feature in the same query.
This is not possible, there is currently no integration of the specialized queries into the Criteria
API.