LUCENE-7787: HeatmapFacetCounter Bits.MatchNoBits optimization

This commit is contained in:
David Smiley 2017-04-18 12:32:12 -04:00
parent d5e5b5e948
commit 7d57d63375
2 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,11 @@ Improvements
* LUCENE-7782: OfflineSorter now passes the total number of items it
will write to getWriter (Mike McCandless)
Optimizations
* LUCENE-7787: spatial-extras HeatmapFacetCounter will now short-circuit it's
work when Bits.MatchNoBits is passed. (David Smiley)
Other
* LUCENE-7754: Inner classes should be static whenever possible.

View File

@ -142,6 +142,9 @@ public class HeatmapFacetCounter {
}
final Heatmap heatmap = new Heatmap(columns, rows, ctx.makeRectangle(heatMinX, heatMaxX, heatMinY, heatMaxY));
if (topAcceptDocs instanceof Bits.MatchNoBits) {
return heatmap; // short-circuit
}
//All ancestor cell counts (of facetLevel) will be captured during facet visiting and applied later. If the data is
// just points then there won't be any ancestors.