java.lang.Object
org.elasticsearch.script.DocBasedScript
org.elasticsearch.script.AbstractFieldScript
- Direct Known Subclasses:
- AbstractLongFieldScript,- BooleanFieldScript,- CompositeFieldScript,- DoubleFieldScript,- IpFieldScript,- StringFieldScript
Abstract base for scripts to execute to build scripted fields. Inspired by
 
AggregationScript but hopefully with less historical baggage.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Stringstatic final intThe maximum number of values a script should be allowed to emit.protected final SourceLookupFields inherited from class org.elasticsearch.script.DocBasedScriptdocReader
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidcheckMaxSize(int currentSize) Check if the we can add another value to the list of values.protected final voidemitFromCompositeScript(CompositeFieldScript compositeFieldScript) protected abstract voidprotected final voidprotected voidabstract voidexecute()extractFromSource(String path) Expose theparamsof the script to the script itself.Methods inherited from class org.elasticsearch.script.DocBasedScriptdocAsMap, field, fields, getDoc, setDocument
- 
Field Details- 
MAX_VALUESpublic static final int MAX_VALUESThe maximum number of values a script should be allowed to emit.- See Also:
 
- 
fieldName
- 
sourceLookup
 
- 
- 
Constructor Details- 
AbstractFieldScriptpublic AbstractFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx) 
 
- 
- 
Method Details- 
getParamsExpose theparamsof the script to the script itself.
- 
extractFromSource
- 
emitFromCompositeScript
- 
emitValueFromCompositeScript
- 
emitFromObject
- 
emitFromSourceprotected final void emitFromSource()
- 
checkMaxSizeprotected final void checkMaxSize(int currentSize) Check if the we can add another value to the list of values.- Parameters:
- currentSize- the current size of the list
 
- 
executepublic abstract void execute()
 
-