Package org.opensearch.script
Class DerivedFieldScript
java.lang.Object
org.opensearch.script.DerivedFieldScript
Definition of Script for DerivedField.
It will be used to execute scripts defined against derived fields of any type
- Opensearch.internal:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A factory to construct statefulDerivedFieldScript
factories for a specific index.static interface
A factory to constructDerivedFieldScript
instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScriptContext
<DerivedFieldScript.Factory> static final String[]
-
Constructor Summary
ConstructorsConstructorDescriptionDerivedFieldScript
(Map<String, Object> params, SearchLookup lookup, org.apache.lucene.index.LeafReaderContext leafContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
execute()
Map
<String, ScriptDocValues<?>> getDoc()
The doc lookup for the Lucene segment this script was created for.Return the emitted values from the script execution.Return the parameters for this script.void
setDocument
(int docid) Set the current document to run the script on next.
-
Field Details
-
PARAMETERS
-
CONTEXT
-
-
Constructor Details
-
DerivedFieldScript
public DerivedFieldScript(Map<String, Object> params, SearchLookup lookup, org.apache.lucene.index.LeafReaderContext leafContext)
-
-
Method Details
-
getParams
Return the parameters for this script. -
getDoc
The doc lookup for the Lucene segment this script was created for. -
getEmittedValues
Return the emitted values from the script execution. -
setDocument
public void setDocument(int docid) Set the current document to run the script on next. Clears the emittedValues as well since they should be scoped per document. -
addEmittedValue
-
execute
public void execute()
-