org.elasticsearch.search.facet.termsstats
Class TermsStatsFacetBuilder

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

public class TermsStatsFacetBuilder
extends AbstractFacetBuilder


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
TermsStatsFacetBuilder(String name)
          Constructs a new terms stats facet builder under the provided facet name.
 
Method Summary
 TermsStatsFacetBuilder allTerms()
          Marks all terms to be returned, even ones with 0 counts.
 TermsStatsFacetBuilder keyField(String keyField)
           
 TermsStatsFacetBuilder lang(String lang)
          The language of the script.
 TermsStatsFacetBuilder order(TermsStatsFacet.ComparatorType comparatorType)
          The order by which to return the facets by.
 TermsStatsFacetBuilder param(String name, Object value)
          A parameter that will be passed to the script.
 TermsStatsFacetBuilder size(int size)
          Sets the size of the result.
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 TermsStatsFacetBuilder valueField(String valueField)
           
 TermsStatsFacetBuilder valueScript(String script)
          A value script to be executed (instead of value field) which results (numeric) will be used to compute the totals.
 
Methods inherited from class org.elasticsearch.search.facet.AbstractFacetBuilder
addFilterFacetAndGlobal, facetFilter, global, nested, scope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermsStatsFacetBuilder

public TermsStatsFacetBuilder(String name)
Constructs a new terms stats facet builder under the provided facet name.

Method Detail

keyField

public TermsStatsFacetBuilder keyField(String keyField)

valueField

public TermsStatsFacetBuilder valueField(String valueField)

order

public TermsStatsFacetBuilder order(TermsStatsFacet.ComparatorType comparatorType)
The order by which to return the facets by. Defaults to TermsStatsFacet.ComparatorType.COUNT.


size

public TermsStatsFacetBuilder size(int size)
Sets the size of the result.


allTerms

public TermsStatsFacetBuilder allTerms()
Marks all terms to be returned, even ones with 0 counts.


valueScript

public TermsStatsFacetBuilder valueScript(String script)
A value script to be executed (instead of value field) which results (numeric) will be used to compute the totals.


lang

public TermsStatsFacetBuilder lang(String lang)
The language of the script.


param

public TermsStatsFacetBuilder param(String name,
                                    Object value)
A parameter that will be passed to the script.

Parameters:
name - The name of the script parameter.
value - The value of the script parameter.

toXContent

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


Copyright © 2009-2012. All Rights Reserved.