org.elasticsearch.search.sort
Class ScriptSortBuilder
java.lang.Object
org.elasticsearch.search.sort.SortBuilder
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.
Constructor Summary |
ScriptSortBuilder(java.lang.String script,
java.lang.String type)
Constructs a script sort builder with the script and the type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScriptSortBuilder
public ScriptSortBuilder(java.lang.String script,
java.lang.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".
param
public ScriptSortBuilder param(java.lang.String name,
java.lang.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
lang
public ScriptSortBuilder lang(java.lang.String lang)
- The language of the script.
toXContent
public void toXContent(XContentBuilder builder,
ToXContent.Params params)
throws java.io.IOException
- Throws:
java.io.IOException