org.elasticsearch.action.terms
Class TermsResponse

java.lang.Object
  extended by org.elasticsearch.action.support.broadcast.BroadcastOperationResponse
      extended by org.elasticsearch.action.terms.TermsResponse
All Implemented Interfaces:
java.lang.Iterable<FieldTermsFreq>, ActionResponse, Streamable

public class TermsResponse
extends BroadcastOperationResponse
implements java.lang.Iterable<FieldTermsFreq>

The response of terms request. Includes a list of FieldTermsFreq which include the field and all its term / doc freq pair.


Method Summary
 long deletedDocs()
          The number of deleted docs.
 FieldTermsFreq field(java.lang.String fieldName)
          The FieldTermsFreq for the specified field name, null if there is none.
 FieldTermsFreq[] fields()
          All the FieldTermsFreq.
 java.util.Map<java.lang.String,FieldTermsFreq> fieldsAsMap()
          The pair of field name to FieldTermsFreq as map for simpler usage.
 java.util.Iterator<FieldTermsFreq> iterator()
          Iterates over the FieldTermsFreq.
 long maxDoc()
          The total maximum number of documents (including deletions).
 long numDocs()
          The total number of documents.
 void readFrom(StreamInput in)
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class org.elasticsearch.action.support.broadcast.BroadcastOperationResponse
failedShards, shardFailures, successfulShards, totalShards
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

numDocs

public long numDocs()
The total number of documents.


maxDoc

public long maxDoc()
The total maximum number of documents (including deletions).


deletedDocs

public long deletedDocs()
The number of deleted docs.


iterator

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

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

field

public FieldTermsFreq field(java.lang.String fieldName)
The FieldTermsFreq for the specified field name, null if there is none.

Parameters:
fieldName - The field name to return the field terms freq for
Returns:
The field terms freq

fields

public FieldTermsFreq[] fields()
All the FieldTermsFreq.


fieldsAsMap

public java.util.Map<java.lang.String,FieldTermsFreq> fieldsAsMap()
The pair of field name to FieldTermsFreq as map for simpler usage.


readFrom

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

writeTo

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