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 class
DoubleFieldScript.Emit
static interface
DoubleFieldScript.Factory
static interface
DoubleFieldScript.LeafFactory
-
Field Summary
Fields Modifier and Type Field Description static ScriptContext<DoubleFieldScript.Factory>
CONTEXT
static java.lang.String[]
PARAMETERS
Fields 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 int
count()
The number of results produced the last timerunForDoc(int)
was called.void
emit(double v)
void
runForDoc(int docId)
Execute the script for the provideddocId
.void
runForDoc(int docId, java.util.function.DoubleConsumer consumer)
Execute the script for the provideddocId
, passing results to theconsumer
double[]
values()
Values from the last timerunForDoc(int)
was called.Methods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, execute, extractFromSource, getDoc, getParams, setDocument
Methods 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)
-