add filter and global support

This commit is contained in:
kimchy 2010-08-01 17:09:40 +03:00
parent e77d1d0147
commit 9f441d8b9f
1 changed files with 11 additions and 0 deletions

View File

@ -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 + "]");