Also remove scope from facet builders. Fixes build.

This commit is contained in:
Martijn van Groningen 2013-01-31 16:34:45 +01:00
parent 46dd42920c
commit d4ef4697d5
12 changed files with 5 additions and 119 deletions

View File

@ -22,7 +22,6 @@ package org.elasticsearch.search.facet;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.query.FilterBuilder;
import org.elasticsearch.search.internal.ContextIndexSearcher;
import java.io.IOException;
@ -33,10 +32,10 @@ public abstract class AbstractFacetBuilder implements ToXContent {
protected final String name;
protected String scope;
protected FilterBuilder facetFilter;
protected Boolean global;
protected String nested;
protected AbstractFacetBuilder(String name) {
@ -61,15 +60,7 @@ public abstract class AbstractFacetBuilder implements ToXContent {
* Marks the facet to run in a global scope, not bounded by any query.
*/
public AbstractFacetBuilder global(boolean global) {
this.scope = ContextIndexSearcher.Scopes.GLOBAL;
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
public AbstractFacetBuilder scope(String scope) {
this.scope = scope;
this.global = global;
return this;
}
@ -83,8 +74,8 @@ public abstract class AbstractFacetBuilder implements ToXContent {
builder.field("nested", nested);
}
if (scope != null) {
builder.field("scope", scope);
if (global != null) {
builder.field("global", global);
}
}
}

View File

@ -187,15 +187,6 @@ public class DateHistogramFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public DateHistogramFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
/**
* An additional filter used to further filter down the set of documents the facet will run on.
*/

View File

@ -46,15 +46,6 @@ public class FilterFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public FilterFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
public FilterFacetBuilder facetFilter(FilterBuilder filter) {
this.facetFilter = filter;
return this;

View File

@ -202,15 +202,6 @@ public class GeoDistanceFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public GeoDistanceFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
public GeoDistanceFacetBuilder facetFilter(FilterBuilder filter) {
this.facetFilter = filter;
return this;

View File

@ -29,8 +29,6 @@ import java.util.concurrent.TimeUnit;
/**
* A facet builder of histogram facets.
*
*
*/
public class HistogramFacetBuilder extends AbstractFacetBuilder {
private String keyFieldName;
@ -116,15 +114,6 @@ public class HistogramFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public HistogramFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
/**
* An additional filter used to further filter down the set of documents the facet will run on.
*/

View File

@ -96,15 +96,6 @@ public class HistogramScriptFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public HistogramScriptFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
/**
* Sets the bounds from and to for the facet. Both performs bounds check and includes only
* values within the bounds, and improves performance.

View File

@ -47,15 +47,6 @@ public class QueryFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public QueryFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
public QueryFacetBuilder facetFilter(FilterBuilder filter) {
this.facetFilter = filter;
return this;

View File

@ -30,8 +30,6 @@ import java.util.List;
/**
* A facet builder of range facets.
*
*
*/
public class RangeFacetBuilder extends AbstractFacetBuilder {
@ -133,15 +131,6 @@ public class RangeFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public RangeFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
/**
* An additional filter used to further filter down the set of documents the facet will run on.
*/

View File

@ -112,15 +112,6 @@ public class RangeScriptFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public RangeScriptFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
public RangeScriptFacetBuilder facetFilter(FilterBuilder filter) {
this.facetFilter = filter;
return this;

View File

@ -58,15 +58,6 @@ public class StatisticalFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public StatisticalFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
public StatisticalFacetBuilder facetFilter(FilterBuilder filter) {
this.facetFilter = filter;
return this;

View File

@ -48,15 +48,6 @@ public class StatisticalScriptFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public AbstractFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
public StatisticalScriptFacetBuilder facetFilter(FilterBuilder filter) {
this.facetFilter = filter;
return this;

View File

@ -31,8 +31,6 @@ import java.util.Map;
/**
* Term facets allow to collect frequency of terms within one (or more) field.
*
*
*/
public class TermsFacetBuilder extends AbstractFacetBuilder {
private String fieldName;
@ -66,15 +64,6 @@ public class TermsFacetBuilder extends AbstractFacetBuilder {
return this;
}
/**
* Marks the facet to run in a specific scope.
*/
@Override
public TermsFacetBuilder scope(String scope) {
super.scope(scope);
return this;
}
/**
* An additional facet filter that will further filter the documents the facet will be
* executed on.