Search in sources :

Example 1 with Bucket

use of org.alfresco.solr.tracker.TrackerStats.Bucket in project SearchServices by Alfresco.

the class ContentSizeGroupingCollector method finish.

public void finish() throws IOException {
    NamedList<Object> analytics = new NamedList<>();
    rb.rsp.add("analytics", analytics);
    NamedList<Object> fieldCounts = new NamedList<>();
    analytics.add("contentSize()", fieldCounts);
    for (Bucket bucket : stats.getHistogram()) {
        fieldCounts.add("[" + (long) Math.ceil(bucket.leftBoundary) + " TO " + (long) Math.ceil(bucket.rightBoundary) + ">", (long) roundEven(bucket.countLeft + bucket.countRight));
    }
    if (this.delegate instanceof DelegatingCollector) {
        ((DelegatingCollector) this.delegate).finish();
    }
}
Also used : DelegatingCollector(org.apache.solr.search.DelegatingCollector) Bucket(org.alfresco.solr.tracker.TrackerStats.Bucket) NamedList(org.apache.solr.common.util.NamedList)

Aggregations

Bucket (org.alfresco.solr.tracker.TrackerStats.Bucket)1 NamedList (org.apache.solr.common.util.NamedList)1 DelegatingCollector (org.apache.solr.search.DelegatingCollector)1