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(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 factor(float factor)
          Sets the factor that will be used to multiply the value with before and divided by after the rounding of the results.
 DateHistogramFacetBuilder field(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(String interval)
          The interval used to control the bucket "size" where each key value of a hit will fall into.
 DateHistogramFacetBuilder keyField(String keyField)
          The field name to use in order to control where the hit will "fall into" within the histogram entries.
 DateHistogramFacetBuilder lang(String lang)
          The language of the value script.
 DateHistogramFacetBuilder nested(String nested)
          Sets the nested path the facet will execute on.
 DateHistogramFacetBuilder param(String name, Object value)
           
 DateHistogramFacetBuilder postOffset(TimeValue postOffset)
          Sets a post offset that will be applied after rounding the results.
 DateHistogramFacetBuilder postZone(String postZone)
          Sets the post time zone to use when bucketing the values.
 DateHistogramFacetBuilder preOffset(TimeValue preOffset)
          Sets a pre offset that will be applied before rounding the results.
 DateHistogramFacetBuilder preZone(String preZone)
          Sets the pre time zone to use when bucketing the values.
 DateHistogramFacetBuilder preZoneAdjustLargeInterval(boolean preZoneAdjustLargeInterval)
          Should pre zone be adjusted for large (day and above) intervals.
 DateHistogramFacetBuilder scope(String scope)
          Marks the facet to run in a specific scope.
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 DateHistogramFacetBuilder 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).
 DateHistogramFacetBuilder valueScript(String valueScript)
           
 
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(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(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(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(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(String valueScript)

param

public DateHistogramFacetBuilder param(String name,
                                       Object value)

lang

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


interval

public DateHistogramFacetBuilder interval(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.


preZoneAdjustLargeInterval

public DateHistogramFacetBuilder preZoneAdjustLargeInterval(boolean preZoneAdjustLargeInterval)
Should pre zone be adjusted for large (day and above) intervals. Defaults to false.


preZone

public DateHistogramFacetBuilder preZone(String preZone)
Sets the pre time zone to use when bucketing the values. This timezone will be applied before rounding off the result.

Can either be in the form of "-10:00" or one of the values listed here: http://joda-time.sourceforge.net/timezones.html.


postZone

public DateHistogramFacetBuilder postZone(String postZone)
Sets the post time zone to use when bucketing the values. This timezone will be applied after rounding off the result.

Can either be in the form of "-10:00" or one of the values listed here: http://joda-time.sourceforge.net/timezones.html.


preOffset

public DateHistogramFacetBuilder preOffset(TimeValue preOffset)
Sets a pre offset that will be applied before rounding the results.


postOffset

public DateHistogramFacetBuilder postOffset(TimeValue postOffset)
Sets a post offset that will be applied after rounding the results.


factor

public DateHistogramFacetBuilder factor(float factor)
Sets the factor that will be used to multiply the value with before and divided by after the rounding of the results.


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(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(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 IOException
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.