Description
When I get some spare time, I am planning to take a look into using DocValuesSkipper for range facets (ideally in the sandbox facets if possible).
As reference, it is already being used in HistogramCollector.java.
Some extra background info I lifted about DocValuesSkipper:
the histogram collector bulk-counts whole blocks of docs using the doc-values skip index; do the same for range facets. When a dense skip-block's value range falls entirely inside one facet range, we can add the block's doc count in one shot instead of reading doc values and binary-searching per document.
Edit 16/6: I think we should start with LongRangeFacetCutter, since it stores raw longs as doc-values so the skipper's min/max will map to the range boundaries (unlike doubles, which has encoded DVs).
Reading HistogramCollector, it uses the DocValuesSkipper in collect(int doc) (per-doc) and collect(DocIdStream stream) (whole block at once). For range facets, we can do the per-doc part inside advanceExact(int doc), using the skipper to skip the value lookup (and the binary search) when a dense block falls entirely within one interval.
Description
When I get some spare time, I am planning to take a look into using DocValuesSkipper for range facets (ideally in the sandbox facets if possible).
As reference, it is already being used in HistogramCollector.java.
Some extra background info I lifted about DocValuesSkipper:
Edit 16/6: I think we should start with LongRangeFacetCutter, since it stores raw longs as doc-values so the skipper's min/max will map to the range boundaries (unlike doubles, which has encoded DVs).
Reading HistogramCollector, it uses the DocValuesSkipper in
collect(int doc)(per-doc) andcollect(DocIdStream stream)(whole block at once). For range facets, we can do the per-doc part inside advanceExact(int doc), using the skipper to skip the value lookup (and the binary search) when a dense block falls entirely within one interval.