Skip to content

Can we use DocValuesSkipper for range facets? #16249

@slow-J

Description

@slow-J

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions