org.elasticsearch.search.facet.geodistance
Class InternalGeoDistanceFacet

java.lang.Object
  extended by org.elasticsearch.search.facet.geodistance.InternalGeoDistanceFacet
All Implemented Interfaces:
java.lang.Iterable<GeoDistanceFacet.Entry>, Streamable, ToXContent, Facet, GeoDistanceFacet, InternalFacet

public class InternalGeoDistanceFacet
extends java.lang.Object
implements GeoDistanceFacet, InternalFacet


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.search.facet.geodistance.GeoDistanceFacet
GeoDistanceFacet.Entry
 
Nested classes/interfaces inherited from interface org.elasticsearch.search.facet.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
InternalGeoDistanceFacet(java.lang.String name, java.lang.String fieldName, java.lang.String valueFieldName, DistanceUnit unit, GeoDistanceFacet.Entry[] entries)
           
 
Method Summary
 Facet aggregate(java.lang.Iterable<Facet> facets)
          Aggregate the data of the provided facets and returns the aggregated value.
 java.util.List<GeoDistanceFacet.Entry> entries()
          An ordered list of geo distance facet entries.
 java.lang.String fieldName()
           
 java.util.List<GeoDistanceFacet.Entry> getEntries()
          An ordered list of geo distance facet entries.
 java.lang.String getFieldName()
           
 java.lang.String getName()
          The "logical" name of the search facet.
 Facet.Type getType()
          The type of the facet.
 DistanceUnit getUnit()
           
 java.lang.String getValueFieldName()
           
 java.util.Iterator<GeoDistanceFacet.Entry> iterator()
           
 java.lang.String name()
          The "logical" name of the search facet.
 void readFrom(StreamInput in)
           
static InternalGeoDistanceFacet readGeoDistanceFacet(StreamInput in)
           
 void toXContent(XContentBuilder builder, ToXContent.Params params)
           
 Facet.Type type()
          The type of the facet.
 DistanceUnit unit()
           
 java.lang.String valueFieldName()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalGeoDistanceFacet

public InternalGeoDistanceFacet(java.lang.String name,
                                java.lang.String fieldName,
                                java.lang.String valueFieldName,
                                DistanceUnit unit,
                                GeoDistanceFacet.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

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

fieldName

public java.lang.String fieldName()
Specified by:
fieldName in interface GeoDistanceFacet

getFieldName

public java.lang.String getFieldName()
Specified by:
getFieldName in interface GeoDistanceFacet

valueFieldName

public java.lang.String valueFieldName()
Specified by:
valueFieldName in interface GeoDistanceFacet

getValueFieldName

public java.lang.String getValueFieldName()
Specified by:
getValueFieldName in interface GeoDistanceFacet

unit

public DistanceUnit unit()
Specified by:
unit in interface GeoDistanceFacet

getUnit

public DistanceUnit getUnit()
Specified by:
getUnit in interface GeoDistanceFacet

entries

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

Specified by:
entries in interface GeoDistanceFacet

getEntries

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

Specified by:
getEntries in interface GeoDistanceFacet

iterator

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

readGeoDistanceFacet

public static InternalGeoDistanceFacet readGeoDistanceFacet(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

toXContent

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