Package org.elasticsearch.script
Class FilterScript
java.lang.Object
org.elasticsearch.script.FilterScript
A script implementation of a query filter.
See
ScriptQueryBuilder
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A factory to construct statefulFilterScript
factories for a specific index.static interface
A factory to constructFilterScript
instances. -
Field Summary
Modifier and TypeFieldDescriptionstatic ScriptContext<FilterScript.Factory>
The context used to compileFilterScript
factories.static String[]
-
Constructor Summary
ConstructorDescriptionFilterScript(Map<String,Object> params, SearchLookup lookup, org.apache.lucene.index.LeafReaderContext leafContext)
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
execute()
Returntrue
if the current document matches the filter, orfalse
otherwise.Map<String,ScriptDocValues<?>>
getDoc()
The doc lookup for the Lucene segment this script was created for.Return the parameters for this script.void
setDocument(int docid)
Set the current document to run the script on next.
-
Field Details
-
PARAMETERS
-
CONTEXT
The context used to compileFilterScript
factories.
-
-
Constructor Details
-
FilterScript
public FilterScript(Map<String,Object> params, SearchLookup lookup, org.apache.lucene.index.LeafReaderContext leafContext)
-
-
Method Details
-
execute
public abstract boolean execute()Returntrue
if the current document matches the filter, orfalse
otherwise. -
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.
-