org.elasticsearch.search.facets
Class Facets

java.lang.Object
  extended by org.elasticsearch.search.facets.Facets
All Implemented Interfaces:
java.lang.Iterable<Facet>, Streamable, ToXContent

public class Facets
extends java.lang.Object
implements Streamable, ToXContent, java.lang.Iterable<Facet>

Facets of search action.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.util.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.util.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
Facets(java.util.List<Facet> facets)
          Constructs a new facets.
 
Method Summary
 CountFacet countFacet(java.lang.String name)
          A specific count facet against the registered facet name.
 Facet facet(java.lang.String name)
          A facet of the specified name.
 java.util.List<Facet> facets()
          The list of Facets.
 java.util.Map<java.lang.String,Facet> facetsAsMap()
          Returns the Facets keyed by map.
 java.util.Map<java.lang.String,Facet> getFacets()
          Returns the Facets keyed by map.
 java.util.Iterator<Facet> iterator()
          Iterates over the Facets.
static Facets readFacets(StreamInput in)
           
 void readFrom(StreamInput in)
           
 void toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Facets

public Facets(java.util.List<Facet> facets)
Constructs a new facets.

Method Detail

iterator

public java.util.Iterator<Facet> iterator()
Iterates over the Facets.

Specified by:
iterator in interface java.lang.Iterable<Facet>

facets

public java.util.List<Facet> facets()
The list of Facets.


getFacets

public java.util.Map<java.lang.String,Facet> getFacets()
Returns the Facets keyed by map.


facetsAsMap

public java.util.Map<java.lang.String,Facet> facetsAsMap()
Returns the Facets keyed by map.


countFacet

public CountFacet countFacet(java.lang.String name)
A specific count facet against the registered facet name.


facet

public Facet facet(java.lang.String name)
A facet of the specified name.


toXContent

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

readFacets

public static Facets readFacets(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