Class AbstractLongFieldScript

java.lang.Object
org.elasticsearch.script.AbstractFieldScript
org.elasticsearch.script.AbstractLongFieldScript
Direct Known Subclasses:
DateFieldScript, GeoPointFieldScript, LongFieldScript

public abstract class AbstractLongFieldScript
extends AbstractFieldScript
Common base class for script field scripts that return long values.
  • Field Summary

    Fields inherited from class org.elasticsearch.script.AbstractFieldScript

    fieldName, leafSearchLookup, MAX_VALUES
  • Constructor Summary

    Constructors
    Constructor Description
    AbstractLongFieldScript​(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 time runForDoc(int) was called.
    void emit​(long v)  
    void runForDoc​(int docId)
    Execute the script for the provided docId.
    void runForDoc​(int docId, java.util.function.LongConsumer consumer)
    Execute the script for the provided docId, passing results to the consumer
    long[] values()
    Values from the last time runForDoc(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
  • Constructor Details

    • AbstractLongFieldScript

      public AbstractLongFieldScript​(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 provided docId.
    • runForDoc

      public final void runForDoc​(int docId, java.util.function.LongConsumer consumer)
      Execute the script for the provided docId, passing results to the consumer
    • values

      public final long[] values()
      Values from the last time runForDoc(int) was called. This array is mutable and will change with the next call of runForDoc(int). It is also oversized and will contain garbage at all indices at and above count().
    • count

      public final int count()
      The number of results produced the last time runForDoc(int) was called.
    • emit

      public final void emit​(long v)