I am in reference to the NativeSearchQueryBuilder spring data elasticsearch.
What is the way to set a post_filter to a nativeSearchQuery?
It seems possible with the native elasticsearch search api: see here and as follows:
SearchResponse response = client.prepareSearch("index1", "index2")
.setTypes("type1", "type2")
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setQuery(QueryBuilders.termQuery("multi", "test")) // Query
.setPostFilter(FilterBuilders.rangeFilter("age").from(12).to(18)) // Filter
.setFrom(0).setSize(60).setExplain(true)
.execute()
.actionGet();
But I haven't found any way to do it in Spring data elasticsearch.