add filter and global support
This commit is contained in:
parent
e77d1d0147
commit
9f441d8b9f
|
@ -24,6 +24,7 @@ import org.elasticsearch.common.collect.Maps;
|
|||
import org.elasticsearch.common.lucene.geo.GeoDistance;
|
||||
import org.elasticsearch.common.unit.DistanceUnit;
|
||||
import org.elasticsearch.common.xcontent.builder.XContentBuilder;
|
||||
import org.elasticsearch.index.query.xcontent.XContentFilterBuilder;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilderException;
|
||||
import org.elasticsearch.search.facets.AbstractFacetBuilder;
|
||||
|
||||
|
@ -185,6 +186,16 @@ public class GeoDistanceFacetBuilder extends AbstractFacetBuilder {
|
|||
return this;
|
||||
}
|
||||
|
||||
public GeoDistanceFacetBuilder global(boolean global) {
|
||||
this.global = global;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GeoDistanceFacetBuilder filter(XContentFilterBuilder filter) {
|
||||
this.filter = filter;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override public void toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
if (fieldName == null) {
|
||||
throw new SearchSourceBuilderException("field must be set on geo_distance facet for facet [" + name + "]");
|
||||
|
|
Loading…
Reference in New Issue