if (streamId != null && !streamId.isEmpty()) {
filter = "streams:" + streamId;
}
try {
UniversalSearch search = searchFactory.queryWithRangeAndFilter(q, timerange, filter);
DateHistogramResult histogram = search.dateHistogram(interval);
List<Map<String, Long>> results = formatHistogramResults(histogram, maxDataPoints, relative == 0);
Map<String, Object> result = Maps.newHashMap();
AbsoluteRange boundaries = histogram.getHistogramBoundaries();
result.put("time", histogram.getTookMs());