Class DocIdSetBuilder

    • Field Detail

      • maxDoc

        private final int maxDoc
      • threshold

        private final int threshold
      • multivalued

        final boolean multivalued
      • numValuesPerDoc

        final double numValuesPerDoc
      • totalAllocated

        private int totalAllocated
      • counter

        private long counter
    • Constructor Detail

      • DocIdSetBuilder

        public DocIdSetBuilder​(int maxDoc)
        Create a builder that can contain doc IDs between 0 and maxDoc.
      • DocIdSetBuilder

        public DocIdSetBuilder​(int maxDoc,
                               Terms terms)
                        throws java.io.IOException
        Create a DocIdSetBuilder instance that is optimized for accumulating docs that match the given Terms.
        Throws:
        java.io.IOException
      • DocIdSetBuilder

        public DocIdSetBuilder​(int maxDoc,
                               PointValues values,
                               java.lang.String field)
                        throws java.io.IOException
        Create a DocIdSetBuilder instance that is optimized for accumulating docs that match the given PointValues.
        Throws:
        java.io.IOException
      • DocIdSetBuilder

        DocIdSetBuilder​(int maxDoc,
                        int docCount,
                        long valueCount)
    • Method Detail

      • ensureBufferCapacity

        private void ensureBufferCapacity​(int numDocs)
      • additionalCapacity

        private int additionalCapacity​(int numDocs)
      • upgradeToBitSet

        private void upgradeToBitSet()
      • build

        public DocIdSet build()
        Build a DocIdSet from the accumulated doc IDs.
      • concat

        private static DocIdSetBuilder.Buffer concat​(java.util.List<DocIdSetBuilder.Buffer> buffers)
        Concatenate the buffers in any order, leaving at least one empty slot in the end NOTE: this method might reuse one of the arrays
      • dedup

        private static int dedup​(int[] arr,
                                 int length)
      • noDups

        private static boolean noDups​(int[] a,
                                      int len)