Class SamplingWrapper

    • Method Detail

      • setComplementThreshold

        public void setComplementThreshold​(double complementThreshold)
        Description copied from class: FacetsAccumulator
        Set the complement threshold. This threshold will dictate whether the complements optimization is applied. The optimization is to count for less documents. It is useful when the same FacetSearchParams are used for varying sets of documents. The first time complements is used the "total counts" are computed - counting for all the documents in the collection. Then, only the complementing set of documents is considered, and used to decrement from the overall counts, thereby walking through less documents, which is faster.

        Note that this optimization is only available when searching an index whose IndexReader implements both IndexReader.directory() and IndexReader.getVersion() otherwise the optimization is silently disabled regardless of the complement threshold settings.

        For the default settings see FacetsAccumulator.DEFAULT_COMPLEMENT_THRESHOLD.

        To forcing complements in all cases pass FacetsAccumulator.FORCE_COMPLEMENT. This is mostly useful for testing purposes, as forcing complements when only tiny fraction of available documents match the query does not make sense and would incur performance degradations.

        To disable complements pass FacetsAccumulator.DISABLE_COMPLEMENT.

        Overrides:
        setComplementThreshold in class FacetsAccumulator
        Parameters:
        complementThreshold -
        See Also:
        FacetsAccumulator.setComplementThreshold(double)
      • isAllowLabeling

        protected boolean isAllowLabeling()
        Description copied from class: FacetsAccumulator
        Check if labeling is allowed for this accumulator.

        By default labeling is allowed. This allows one accumulator to invoke other accumulators for accumulation but keep to itself the responsibility of labeling. This might br handy since labeling is a costly operation.

        Overrides:
        isAllowLabeling in class FacetsAccumulator
        Returns:
        true of labeling is allowed for this accumulator
        See Also:
        FacetsAccumulator.setAllowLabeling(boolean)