public class RangeFacetBuilder extends FacetBuilder
FacetBuilder.Mode
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
facetFilter, global, mode, name, nested
EMPTY_PARAMS
Constructor and Description |
---|
RangeFacetBuilder(String name)
Constructs a new range facet with the provided facet logical name.
|
Modifier and Type | Method and Description |
---|---|
RangeFacetBuilder |
addRange(double from,
double to)
Adds a range entry with explicit from and to.
|
RangeFacetBuilder |
addRange(String from,
String to) |
RangeFacetBuilder |
addUnboundedFrom(double to)
Adds a range entry with explicit to and unbounded from.
|
RangeFacetBuilder |
addUnboundedFrom(String to) |
RangeFacetBuilder |
addUnboundedTo(double from)
Adds a range entry with explicit from and unbounded to.
|
RangeFacetBuilder |
addUnboundedTo(String from) |
RangeFacetBuilder |
facetFilter(FilterBuilder filter)
An additional filter used to further filter down the set of documents the facet will run on.
|
RangeFacetBuilder |
field(String field)
The field name to perform the range facet.
|
RangeFacetBuilder |
global(boolean global)
Should the facet run in global mode (not bounded by the search query) or not (bounded by
the search query).
|
RangeFacetBuilder |
keyField(String keyField)
The field name to use in order to control where the hit will "fall into" within the range
entries.
|
RangeFacetBuilder |
nested(String nested)
Sets the nested path the facet will execute on.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
RangeFacetBuilder |
valueField(String valueField)
The field name to use as the value of the hit to compute data based on values within the interval
(for example, total).
|
addFilterFacetAndGlobal, mode
public RangeFacetBuilder(String name)
name
- The logical name of the facetpublic RangeFacetBuilder field(String field)
keyField(String)
and valueField(String)
.public RangeFacetBuilder keyField(String keyField)
public RangeFacetBuilder valueField(String valueField)
public RangeFacetBuilder addRange(double from, double to)
from
- The from range limitto
- The to range limitpublic RangeFacetBuilder addRange(String from, String to)
public RangeFacetBuilder addUnboundedTo(double from)
from
- the from range limit, to is unbounded.public RangeFacetBuilder addUnboundedTo(String from)
public RangeFacetBuilder addUnboundedFrom(double to)
to
- the to range limit, from is unbounded.public RangeFacetBuilder addUnboundedFrom(String to)
public RangeFacetBuilder global(boolean global)
global
in class FacetBuilder
public RangeFacetBuilder facetFilter(FilterBuilder filter)
facetFilter
in class FacetBuilder
public RangeFacetBuilder nested(String nested)
nested
in class FacetBuilder
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
Copyright © 2009–2015. All rights reserved.