org.elasticsearch.search.facets.histogram
Class InternalHistogramFacet

java.lang.Object
  extended by org.elasticsearch.search.facets.histogram.InternalHistogramFacet
All Implemented Interfaces:
java.lang.Iterable<HistogramFacet.Entry>, Streamable, ToXContent, Facet, HistogramFacet, InternalFacet

public class InternalHistogramFacet
extends java.lang.Object
implements HistogramFacet, InternalFacet


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.search.facets.histogram.HistogramFacet
HistogramFacet.ComparatorType, HistogramFacet.Entry
 
Nested classes/interfaces inherited from interface org.elasticsearch.search.facets.Facet
Facet.Type
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
InternalHistogramFacet(java.lang.String name, java.lang.String keyFieldName, java.lang.String valueFieldName, long interval, HistogramFacet.ComparatorType comparatorType, org.elasticsearch.common.trove.TLongLongHashMap counts, org.elasticsearch.common.trove.TLongDoubleHashMap totals)
           
 
Method Summary
 Facet aggregate(java.lang.Iterable<Facet> facets)
          Aggregate the data of the provided facets and returns the aggregated value.
 java.util.List<HistogramFacet.Entry> entries()
          An ordered list of histogram facet entries.
 java.util.List<HistogramFacet.Entry> getEntries()
          An ordered list of histogram facet entries.
 java.lang.String getKeyFieldName()
          The key field name used with this facet.
 java.lang.String getName()
          The "logical" name of the search facet.
 Facet.Type getType()
          The type of the facet.
 java.lang.String getValueFieldName()
          The value field name used with this facet.
 java.util.Iterator<HistogramFacet.Entry> iterator()
           
 java.lang.String keyFieldName()
          The key field name used with this facet.
 java.lang.String name()
          The "logical" name of the search facet.
 void readFrom(StreamInput in)
           
static InternalHistogramFacet readHistogramFacet(StreamInput in)
           
 void toXContent(XContentBuilder builder, ToXContent.Params params)
           
 Facet.Type type()
          The type of the facet.
 java.lang.String valueFieldName()
          The value field name used with this facet.
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalHistogramFacet

public InternalHistogramFacet(java.lang.String name,
                              java.lang.String keyFieldName,
                              java.lang.String valueFieldName,
                              long interval,
                              HistogramFacet.ComparatorType comparatorType,
                              org.elasticsearch.common.trove.TLongLongHashMap counts,
                              org.elasticsearch.common.trove.TLongDoubleHashMap totals)
Method Detail

name

public java.lang.String name()
Description copied from interface: Facet
The "logical" name of the search facet.

Specified by:
name in interface Facet

getName

public java.lang.String getName()
Description copied from interface: Facet
The "logical" name of the search facet.

Specified by:
getName in interface Facet

keyFieldName

public java.lang.String keyFieldName()
Description copied from interface: HistogramFacet
The key field name used with this facet.

Specified by:
keyFieldName in interface HistogramFacet

getKeyFieldName

public java.lang.String getKeyFieldName()
Description copied from interface: HistogramFacet
The key field name used with this facet.

Specified by:
getKeyFieldName in interface HistogramFacet

valueFieldName

public java.lang.String valueFieldName()
Description copied from interface: HistogramFacet
The value field name used with this facet.

Specified by:
valueFieldName in interface HistogramFacet

getValueFieldName

public java.lang.String getValueFieldName()
Description copied from interface: HistogramFacet
The value field name used with this facet.

Specified by:
getValueFieldName in interface HistogramFacet

type

public Facet.Type type()
Description copied from interface: Facet
The type of the facet.

Specified by:
type in interface Facet

getType

public Facet.Type getType()
Description copied from interface: Facet
The type of the facet.

Specified by:
getType in interface Facet

entries

public java.util.List<HistogramFacet.Entry> entries()
Description copied from interface: HistogramFacet
An ordered list of histogram facet entries.

Specified by:
entries in interface HistogramFacet

getEntries

public java.util.List<HistogramFacet.Entry> getEntries()
Description copied from interface: HistogramFacet
An ordered list of histogram facet entries.

Specified by:
getEntries in interface HistogramFacet

iterator

public java.util.Iterator<HistogramFacet.Entry> iterator()
Specified by:
iterator in interface java.lang.Iterable<HistogramFacet.Entry>

aggregate

public Facet aggregate(java.lang.Iterable<Facet> facets)
Description copied from interface: InternalFacet
Aggregate the data of the provided facets and returns the aggregated value. Note, this method might should handle cases of facets provided with different names, and should excllude them.

Specified by:
aggregate in interface InternalFacet

toXContent

public void toXContent(XContentBuilder builder,
                       ToXContent.Params params)
                throws java.io.IOException
Specified by:
toXContent in interface ToXContent
Throws:
java.io.IOException

readHistogramFacet

public static InternalHistogramFacet readHistogramFacet(StreamInput in)
                                                 throws java.io.IOException
Throws:
java.io.IOException

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException