Package org.elasticsearch.script
Class DoubleFieldScript
java.lang.Object
org.elasticsearch.script.AbstractFieldScript
org.elasticsearch.script.DoubleFieldScript
public abstract class DoubleFieldScript extends AbstractFieldScript
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDoubleFieldScript.Emitstatic interfaceDoubleFieldScript.Factorystatic interfaceDoubleFieldScript.LeafFactory -
Field Summary
Fields Modifier and Type Field Description static ScriptContext<DoubleFieldScript.Factory>CONTEXTstatic java.lang.String[]PARAMETERSFields inherited from class org.elasticsearch.script.AbstractFieldScript
fieldName, leafSearchLookup, MAX_VALUES -
Constructor Summary
Constructors Constructor Description DoubleFieldScript(java.lang.String fieldName, java.util.Map<java.lang.String,java.lang.Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx) -
Method Summary
Modifier and Type Method Description intcount()The number of results produced the last timerunForDoc(int)was called.voidemit(double v)voidrunForDoc(int docId)Execute the script for the provideddocId.voidrunForDoc(int docId, java.util.function.DoubleConsumer consumer)Execute the script for the provideddocId, passing results to theconsumerdouble[]values()Values from the last timerunForDoc(int)was called.Methods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, execute, extractFromSource, getDoc, getParams, setDocumentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
CONTEXT
-
PARAMETERS
public static final java.lang.String[] PARAMETERS
-
-
Constructor Details
-
DoubleFieldScript
public DoubleFieldScript(java.lang.String fieldName, java.util.Map<java.lang.String,java.lang.Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
runForDoc
public final void runForDoc(int docId)Execute the script for the provideddocId. -
runForDoc
public final void runForDoc(int docId, java.util.function.DoubleConsumer consumer)Execute the script for the provideddocId, passing results to theconsumer -
values
public final double[] values()Values from the last timerunForDoc(int)was called. This array is mutable and will change with the next call ofrunForDoc(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 timerunForDoc(int)was called. -
emit
public final void emit(double v)
-