org.elasticsearch.search.facet.datehistogram
Class DateHistogramFacetBuilder

java.lang.Object
  extended by org.elasticsearch.search.facet.AbstractFacetBuilder
      extended by org.elasticsearch.search.facet.datehistogram.DateHistogramFacetBuilder
All Implemented Interfaces:
ToXContent

public class DateHistogramFacetBuilder
extends AbstractFacetBuilder

A facet builder of date histogram facets.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from class org.elasticsearch.search.facet.AbstractFacetBuilder
facetFilter, name, nested, scope
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
DateHistogramFacetBuilder(java.lang.String name)
          Constructs a new date histogram facet with the provided facet logical name.
 
Method Summary
 DateHistogramFacetBuilder comparator(DateHistogramFacet.ComparatorType comparatorType)
           
 DateHistogramFacetBuilder facetFilter(FilterBuilder filter)
          An additional filter used to further filter down the set of documents the facet will run on.
 DateHistogramFacetBuilder field(java.lang.String field)
          The field name to perform the histogram facet.
 DateHistogramFacetBuilder global(boolean global)
          Should the facet run in global mode (not bounded by the search query) or not (bounded by the search query).
 DateHistogramFacetBuilder interval(java.lang.String interval)
          The interval used to control the bucket "size" where each key value of a hit will fall into.
 DateHistogramFacetBuilder keyField(java.lang.String keyField)
          The field name to use in order to control where the hit will "fall into" within the histogram entries.
 DateHistogramFacetBuilder lang(java.lang.String lang)
          The language of the value script.
 DateHistogramFacetBuilder nested(java.lang.String nested)
          Sets the nested path the facet will execute on.
 DateHistogramFacetBuilder param(java.lang.String name, java.lang.Object value)
           
 DateHistogramFacetBuilder scope(java.lang.String scope)
          Marks the facet to run in a specific scope.
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 DateHistogramFacetBuilder valueField(java.lang.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).
 DateHistogramFacetBuilder valueScript(java.lang.String valueScript)
           
 DateHistogramFacetBuilder zone(java.lang.String zone)
          Sets the time zone to use when bucketing the values.
 
Methods inherited from class org.elasticsearch.search.facet.AbstractFacetBuilder
addFilterFacetAndGlobal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateHistogramFacetBuilder

public DateHistogramFacetBuilder(java.lang.String name)
Constructs a new date histogram facet with the provided facet logical name.

Parameters:
name - The logical name of the facet
Method Detail

field

public DateHistogramFacetBuilder field(java.lang.String field)
The field name to perform the histogram facet. Translates to perform the histogram facet using the provided field as both the keyField(String) and valueField(String).


keyField

public DateHistogramFacetBuilder keyField(java.lang.String keyField)
The field name to use in order to control where the hit will "fall into" within the histogram entries. Essentially, using the key field numeric value, the hit will be "rounded" into the relevant bucket controlled by the interval.


valueField

public DateHistogramFacetBuilder valueField(java.lang.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).


valueScript

public DateHistogramFacetBuilder valueScript(java.lang.String valueScript)

param

public DateHistogramFacetBuilder param(java.lang.String name,
                                       java.lang.Object value)

lang

public DateHistogramFacetBuilder lang(java.lang.String lang)
The language of the value script.


interval

public DateHistogramFacetBuilder interval(java.lang.String interval)
The interval used to control the bucket "size" where each key value of a hit will fall into. Check the docs for all available values.


zone

public DateHistogramFacetBuilder zone(java.lang.String zone)
Sets the time zone to use when bucketing the values. Can either be in the form of "-10:00" or one of the values listed here: http://joda-time.sourceforge.net/timezones.html.


comparator

public DateHistogramFacetBuilder comparator(DateHistogramFacet.ComparatorType comparatorType)

global

public DateHistogramFacetBuilder global(boolean global)
Should the facet run in global mode (not bounded by the search query) or not (bounded by the search query). Defaults to false.

Overrides:
global in class AbstractFacetBuilder

scope

public DateHistogramFacetBuilder scope(java.lang.String scope)
Marks the facet to run in a specific scope.

Overrides:
scope in class AbstractFacetBuilder

facetFilter

public DateHistogramFacetBuilder facetFilter(FilterBuilder filter)
An additional filter used to further filter down the set of documents the facet will run on.

Overrides:
facetFilter in class AbstractFacetBuilder

nested

public DateHistogramFacetBuilder nested(java.lang.String nested)
Sets the nested path the facet will execute on. A match (root object) will then cause all the nested objects matching the path to be computed into the facet.

Overrides:
nested in class AbstractFacetBuilder

toXContent

public XContentBuilder toXContent(XContentBuilder builder,
                                  ToXContent.Params params)
                           throws java.io.IOException
Throws:
java.io.IOException