public class ScriptSortBuilder extends SortBuilder
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
ScriptSortBuilder(String script,
String type)
Constructs a script sort builder with the script and the type.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ScriptSortBuilder |
setNestedFilter(FilterBuilder nestedFilter)
Sets the nested filter that the nested objects should match with in order to be taken into account
for sorting.
|
ScriptSortBuilder |
setNestedPath(String nestedPath)
Sets the nested path if sorting occurs on a field that is inside a nested object.
|
ScriptSortBuilder |
setParams(Map<String,Object> params)
Sets parameters for the script.
|
ScriptSortBuilder |
sortMode(String sortMode)
Defines which distance to use for sorting in the case a document contains multiple geo points.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
toString
public ScriptSortBuilder param(String name, Object value)
name
- The name of the parameter.value
- The value of the parameter.public ScriptSortBuilder setParams(Map<String,Object> params)
params
- The script parameterspublic ScriptSortBuilder order(SortOrder order)
order
in class SortBuilder
public SortBuilder missing(Object missing)
missing
in class SortBuilder
public ScriptSortBuilder lang(String lang)
public ScriptSortBuilder sortMode(String sortMode)
public ScriptSortBuilder setNestedFilter(FilterBuilder nestedFilter)
public ScriptSortBuilder setNestedPath(String nestedPath)
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
Copyright © 2009–2015. All rights reserved.