if (getDataset() != null) { return getDataset(); List<StatisticsFilter> filters = getFilters(); List<String> defaultFilters = new ArrayList<String>(); for (StatisticsFilter statisticsFilter : filters) { String query = getQuery(); List<DatasetGenerator> datasetGenerators = getDatasetGenerators(); if (0 < datasetGenerators.size()) { totalFieldCounts = getTotalFacetCounts(typeGenerator); if (getOldestWorkflowItemDate() != null) { monthDifference = getMonthsDifference(new Date(), getOldestWorkflowItemDate());
/** * Retrieve the total counts for the facets (total count is same query but none of the filter queries). * * @param typeGenerator the type generator * @return counts for each facet by name. * @throws org.apache.solr.client.solrj.SolrServerException passed through. */ protected Map<String, Long> getTotalFacetCounts(DatasetTypeGenerator typeGenerator) throws SolrServerException { ObjectCount[] objectCounts = solrLoggerService .queryFacetField(getQuery(), null, typeGenerator.getType(), -1, false, null); Map<String, Long> result = new HashMap<String, Long>(); for (ObjectCount objectCount : objectCounts) { result.put(objectCount.getValue(), objectCount.getCount()); } return result; }
.query(getQuery(), null, null, 1, 0, null, null, null, null, "time", true); if (0 < oldestRecord.getResults().getNumFound()) { SolrDocument solrDocument = oldestRecord.getResults().get(0);