java.lang.Object
org.elasticsearch.script.DocBasedScript
org.elasticsearch.script.AbstractFieldScript
org.elasticsearch.script.AbstractLongFieldScript
- Direct Known Subclasses:
DateFieldScript,LongFieldScript,SortedNumericDocValuesLongFieldScript
Common base class for script field scripts that return long values.
-
Field Summary
Fields inherited from class org.elasticsearch.script.AbstractFieldScript
fieldName, MAX_VALUES, sourceFields inherited from class org.elasticsearch.script.DocBasedScript
docReader -
Constructor Summary
ConstructorsConstructorDescriptionAbstractLongFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, OnScriptError onScriptError, org.apache.lucene.index.LeafReaderContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionfinal intcount()The number of results produced the last timeAbstractFieldScript.runForDoc(int)was called.final voidemit(long v) protected voidfinal voidrunForDoc(int docId, LongConsumer consumer) Execute the script for the provideddocId, passing results to theconsumerfinal long[]values()Values from the last timeAbstractFieldScript.runForDoc(int)was called.Methods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, emitFromCompositeScript, emitFromObject, emitFromSource, emitValueFromCompositeScript, execute, extractFromSource, getParams, newContext, runForDocMethods inherited from class org.elasticsearch.script.DocBasedScript
docAsMap, field, fields, getDoc, setDocument, source
-
Constructor Details
-
AbstractLongFieldScript
public AbstractLongFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, OnScriptError onScriptError, org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
prepareExecute
protected void prepareExecute()- Specified by:
prepareExecutein classAbstractFieldScript
-
runForDoc
Execute the script for the provideddocId, passing results to theconsumer -
values
public final long[] values()Values from the last timeAbstractFieldScript.runForDoc(int)was called. This array is mutable and will change with the next call ofAbstractFieldScript.runForDoc(int). It is also oversized and will contain garbage at all indices at and abovecount(). -
count
public final int count()The number of results produced the last timeAbstractFieldScript.runForDoc(int)was called. -
emit
public final void emit(long v)
-