Package org.elasticsearch.script
Class FilterScript
java.lang.Object
org.elasticsearch.script.FilterScript
public abstract class FilterScript
extends java.lang.Object
A script implementation of a query filter.
See
ScriptQueryBuilder.-
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 java.lang.String[]PARAMETERS -
Constructor Summary
Constructors Constructor Description FilterScript(java.util.Map<java.lang.String,java.lang.Object> params, SearchLookup lookup, org.apache.lucene.index.LeafReaderContext leafContext) -
Method Summary
Modifier and Type Method Description abstract booleanexecute()Returntrueif the current document matches the filter, orfalseotherwise.java.util.Map<java.lang.String,ScriptDocValues<?>>getDoc()The doc lookup for the Lucene segment this script was created for.java.util.Map<java.lang.String,java.lang.Object>getParams()Return the parameters for this script.voidsetDocument(int docid)Set the current document to run the script on next.
-
Field Details
-
PARAMETERS
public static final java.lang.String[] PARAMETERS -
CONTEXT
The context used to compileFilterScriptfactories.
-
-
Constructor Details
-
FilterScript
public FilterScript(java.util.Map<java.lang.String,java.lang.Object> params, SearchLookup lookup, org.apache.lucene.index.LeafReaderContext leafContext)
-
-
Method Details
-
execute
public abstract boolean execute()Returntrueif the current document matches the filter, orfalseotherwise. -
getParams
public java.util.Map<java.lang.String,java.lang.Object> getParams()Return the parameters for this script. -
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.
-