org.elasticsearch.search.sort
Class FieldSortBuilder

java.lang.Object
  extended by org.elasticsearch.search.sort.SortBuilder
      extended by org.elasticsearch.search.sort.FieldSortBuilder
All Implemented Interfaces:
ToXContent

public class FieldSortBuilder
extends SortBuilder

A sort builder to sort based on a document field.


Nested Class Summary
 
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
FieldSortBuilder(java.lang.String fieldName)
          Constructs a new sort based on a document field.
 
Method Summary
 FieldSortBuilder order(SortOrder order)
          The order of sorting.
 void toXContent(XContentBuilder builder, ToXContent.Params params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldSortBuilder

public FieldSortBuilder(java.lang.String fieldName)
Constructs a new sort based on a document field.

Parameters:
fieldName - The field name.
Method Detail

order

public FieldSortBuilder order(SortOrder order)
The order of sorting. Defaults to SortOrder.ASC.

Specified by:
order in class SortBuilder

toXContent

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