Package org.apache.lucene.facet
Class FacetUtils
- java.lang.Object
-
- org.apache.lucene.facet.FacetUtils
-
public final class FacetUtils extends Object
Utility class with a single method for getting a DocIdSetIterator that skips deleted docs- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DocIdSetIteratorliveDocsDISI(DocIdSetIterator it, Bits liveDocs)Wrap the given DocIdSetIterator and liveDocs into another DocIdSetIterator that returns non-deleted documents during iteration.static SortedNumericDocValuesloadOrdinalValues(LeafReader reader, String fieldName)Deprecated.Please do not rely on this method.static SortedNumericDocValuesloadOrdinalValues(LeafReader reader, String fieldName, BiConsumer<BytesRef,IntsRef> binaryValueDecoder)Deprecated.Please do not rely on this method.
-
-
-
Method Detail
-
liveDocsDISI
public static DocIdSetIterator liveDocsDISI(DocIdSetIterator it, Bits liveDocs)
Wrap the given DocIdSetIterator and liveDocs into another DocIdSetIterator that returns non-deleted documents during iteration. This is useful for computing facet counts on match-all style queries that need to exclude deleted documents.ConjunctionUtilscould be better home for this method if we can identify use cases outside facets module.Making this class pkg-private unfortunately limits the visibility of this method to
SortedSetDocValuesFacetCountsandConcurrentSortedSetDocValuesFacetCountsclasses as Java does not allow pkg-private classes to be visible to sub-packages.- Parameters:
it-DocIdSetIteratorbeing wrappedliveDocs-Bitscontaining set bits for non-deleted docs- Returns:
- wrapped iterator
-
loadOrdinalValues
@Deprecated public static SortedNumericDocValues loadOrdinalValues(LeafReader reader, String fieldName) throws IOException
Deprecated.Please do not rely on this method. It is added as a temporary measure for providing index backwards-compatibility with Lucene 8 and earlier indexes, and will be removed in Lucene 10.Loads ordinal values asSortedNumericDocValues. If the index still uses the older binary format, it will wrap that with the SNDV API. Newer format indexes will just load the SNDV directly.This is really only needed/useful to maintain back-compat with the binary format. Once back-compat is no longer needed, the SNDV field should just be loaded directly.
- Throws:
IOException
-
loadOrdinalValues
@Deprecated public static SortedNumericDocValues loadOrdinalValues(LeafReader reader, String fieldName, BiConsumer<BytesRef,IntsRef> binaryValueDecoder) throws IOException
Deprecated.Please do not rely on this method. It is added as a temporary measure for providing index backwards-compatibility with Lucene 8 and earlier indexes, and will be removed in Lucene 10.Loads ordinal values asSortedNumericDocValues. If the index still uses the older binary format, it will wrap that with the SNDV API. Newer format indexes will just load the SNDV directly. The providedbinaryValueDecoderallows custom decoding logic for older binary format fields to be provided.This is really only needed/useful to maintain back-compat with the binary format. Once back-compat is no longer needed, the SNDV field should just be loaded directly.
- Throws:
IOException
-
-