Class AggregationScript

    • Method Detail

      • getParams

        public Map<String,​Object> getParams()
        Return the parameters for this script.
      • getDoc

        public Map<String,​ScriptDocValues<?>> getDoc()
        The doc lookup for the Lucene segment this script was created for.
      • setDocument

        public void setDocument​(int docid)
        Set the current document to run the script on next.
      • setNextAggregationValue

        public void setNextAggregationValue​(Object value)
        Sets per-document aggregation _value.

        The default implementation just calls setNextVar("_value", value) but some engines might want to handle this differently for better performance.

        Parameters:
        value - per-document value, typically a String, Long, or Double
      • get_score

        public Number get_score()
      • get_value

        public Object get_value()
      • runAsLong

        public long runAsLong()
        Return the result as a long. This is used by aggregation scripts over long fields.
      • runAsDouble

        public double runAsDouble()
      • execute

        public abstract Object execute()