@Override
    public void onValue(int docId, long value) {
      valueScript.setNextDocId(docId);
      long time = tzRounding.calc(value);
      double scriptValue = valueScript.runAsDouble();

      InternalFullDateHistogramFacet.FullEntry entry = entries.get(time);
      if (entry == null) {
        entry =
            new InternalFullDateHistogramFacet.FullEntry(
                time, 1, scriptValue, scriptValue, 1, scriptValue);
        entries.put(time, entry);
      } else {
        entry.count++;
        entry.totalCount++;
        entry.total += scriptValue;
        if (scriptValue < entry.min) {
          entry.min = scriptValue;
        }
        if (scriptValue > entry.max) {
          entry.max = scriptValue;
        }
      }
    }
    @Override
    public void onValue(int docId, double value) {
      valueScript.setNextDocId(docId);
      long bucket = bucket(value, interval);
      double scriptValue = valueScript.runAsDouble();

      InternalFullHistogramFacet.FullEntry entry = entries.get(bucket);
      if (entry == null) {
        entry =
            new InternalFullHistogramFacet.FullEntry(
                bucket, 1, scriptValue, scriptValue, 1, scriptValue);
        entries.put(bucket, entry);
      } else {
        entry.count++;
        entry.totalCount++;
        entry.total += scriptValue;
        if (scriptValue < entry.min) {
          entry.min = scriptValue;
        }
        if (scriptValue > entry.max) {
          entry.max = scriptValue;
        }
      }
    }