org.elasticsearch.search.facet.terms
Class InternalTermsFacet

java.lang.Object
  extended by org.elasticsearch.search.facet.terms.InternalTermsFacet
All Implemented Interfaces:
java.lang.Iterable<TermsFacet.Entry>, Streamable, ToXContent, Facet, InternalFacet, TermsFacet

public class InternalTermsFacet
extends java.lang.Object
implements InternalFacet, TermsFacet


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Nested classes/interfaces inherited from interface org.elasticsearch.search.facet.terms.TermsFacet
TermsFacet.ComparatorType, TermsFacet.Entry
 
Nested classes/interfaces inherited from interface org.elasticsearch.search.facet.Facet
Facet.Type
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
InternalTermsFacet(java.lang.String name, java.lang.String fieldName, TermsFacet.ComparatorType comparatorType, int requiredSize, java.util.Collection<TermsFacet.Entry> entries)
           
 
Method Summary
 Facet aggregate(java.lang.Iterable<Facet> facets)
          Aggregate the data of the provided facets and returns the aggregated value.
 TermsFacet.ComparatorType comparatorType()
          The ordering of the results.
 java.util.List<TermsFacet.Entry> entries()
          The terms and counts.
 java.lang.String fieldName()
          The field name the terms were extracted from.
 TermsFacet.ComparatorType getComparatorType()
          The ordering of the results.
 java.util.List<TermsFacet.Entry> getEntries()
          The terms and counts.
 java.lang.String getFieldName()
          The field name the terms were extracted from.
 java.lang.String getName()
          The "logical" name of the search facet.
 Facet.Type getType()
          The type of the facet.
 java.util.Iterator<TermsFacet.Entry> iterator()
           
 java.lang.String name()
          The "logical" name of the search facet.
 void readFrom(StreamInput in)
           
static InternalTermsFacet readTermsFacet(StreamInput in)
           
 void toXContent(XContentBuilder builder, ToXContent.Params params)
           
 Facet.Type type()
          The type of the 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

InternalTermsFacet

public InternalTermsFacet(java.lang.String name,
                          java.lang.String fieldName,
                          TermsFacet.ComparatorType comparatorType,
                          int requiredSize,
                          java.util.Collection<TermsFacet.Entry> entries)
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

fieldName

public java.lang.String fieldName()
Description copied from interface: TermsFacet
The field name the terms were extracted from.

Specified by:
fieldName in interface TermsFacet

getFieldName

public java.lang.String getFieldName()
Description copied from interface: TermsFacet
The field name the terms were extracted from.

Specified by:
getFieldName in interface TermsFacet

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

comparatorType

public TermsFacet.ComparatorType comparatorType()
Description copied from interface: TermsFacet
The ordering of the results.

Specified by:
comparatorType in interface TermsFacet

getComparatorType

public TermsFacet.ComparatorType getComparatorType()
Description copied from interface: TermsFacet
The ordering of the results.

Specified by:
getComparatorType in interface TermsFacet

entries

public java.util.List<TermsFacet.Entry> entries()
Description copied from interface: TermsFacet
The terms and counts.

Specified by:
entries in interface TermsFacet

getEntries

public java.util.List<TermsFacet.Entry> getEntries()
Description copied from interface: TermsFacet
The terms and counts.

Specified by:
getEntries in interface TermsFacet

iterator

public java.util.Iterator<TermsFacet.Entry> iterator()
Specified by:
iterator in interface java.lang.Iterable<TermsFacet.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

readTermsFacet

public static InternalTermsFacet readTermsFacet(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