Package org.elasticsearch.script
Class FilterScript
- java.lang.Object
-
- org.elasticsearch.script.FilterScript
-
public abstract class FilterScript extends Object
A script implementation of a query filter. SeeScriptQueryBuilder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFilterScript.FactoryA factory to construct statefulFilterScriptfactories for a specific index.static interfaceFilterScript.LeafFactoryA factory to constructFilterScriptinstances.
-
Field Summary
Fields Modifier and Type Field Description static ScriptContext<FilterScript.Factory>CONTEXTThe context used to compileFilterScriptfactories.static String[]PARAMETERS
-
Constructor Summary
Constructors Constructor Description FilterScript(Map<String,Object> params, SearchLookup lookup, LeafReaderContext leafContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanexecute()Returntrueif the current document matches the filter, orfalseotherwise.Map<String,ScriptDocValues<?>>getDoc()The doc lookup for the Lucene segment this script was created for.Map<String,Object>getParams()Return the parameters for this script.voidsetDocument(int docid)Set the current document to run the script on next.
-
-
-
Field Detail
-
PARAMETERS
public static final String[] PARAMETERS
-
CONTEXT
public static final ScriptContext<FilterScript.Factory> CONTEXT
The context used to compileFilterScriptfactories.
-
-
Constructor Detail
-
FilterScript
public FilterScript(Map<String,Object> params, SearchLookup lookup, LeafReaderContext leafContext)
-
-
Method Detail
-
execute
public abstract boolean execute()
Returntrueif the current document matches the filter, orfalseotherwise.
-
getDoc
public final Map<String,ScriptDocValues<?>> getDoc()
The doc lookup for the Lucene segment this script was created for.
-
setDocument
public void setDocument(int docid)
Set the current document to run the script on next.
-
-