org.elasticsearch.search.sort
Class ScriptSortBuilder

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

public class ScriptSortBuilder
extends SortBuilder

Script sort builder allows to sort based on a custom script expression.


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
ScriptSortBuilder(String script, String type)
          Constructs a script sort builder with the script and the type.
 
Method Summary
 ScriptSortBuilder lang(String lang)
          The language of the script.
 SortBuilder missing(Object missing)
          Not really relevant.
 ScriptSortBuilder order(SortOrder order)
          Sets the sort order.
 ScriptSortBuilder param(String name, Object value)
          Adds a parameter to the script.
 XContentBuilder 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

ScriptSortBuilder

public ScriptSortBuilder(String script,
                         String type)
Constructs a script sort builder with the script and the type.

Parameters:
script - The script to use.
type - The type, can either be "string" or "number".
Method Detail

param

public ScriptSortBuilder param(String name,
                               Object value)
Adds a parameter to the script.

Parameters:
name - The name of the parameter.
value - The value of the parameter.

order

public ScriptSortBuilder order(SortOrder order)
Sets the sort order.

Specified by:
order in class SortBuilder

missing

public SortBuilder missing(Object missing)
Not really relevant.

Specified by:
missing in class SortBuilder

lang

public ScriptSortBuilder lang(String lang)
The language of the script.


toXContent

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


Copyright © 2009-2012. All Rights Reserved.