Class Comparisons.TextContainsAllPrefixesComparison

    • Constructor Detail

      • TextContainsAllPrefixesComparison

        public TextContainsAllPrefixesComparison​(@Nonnull
                                                 String tokenPrefixes,
                                                 boolean strict,
                                                 long expectedRecords,
                                                 double falsePositivePercentage,
                                                 @Nullable
                                                 String tokenizerName,
                                                 @Nonnull
                                                 String fallbackTokenizerName)
      • TextContainsAllPrefixesComparison

        public TextContainsAllPrefixesComparison​(@Nonnull
                                                 List<String> tokenPrefixes,
                                                 boolean strict,
                                                 long expectedRecords,
                                                 double falsePositivePercentage,
                                                 @Nullable
                                                 String tokenizerName,
                                                 @Nonnull
                                                 String fallbackTokenizerName)
    • Method Detail

      • isStrict

        public boolean isStrict()
        Whether this comparison should be strictly evaluated. This is used during query planning to determine whether it is acceptable to return false positives.
        Returns:
        false if false positives are acceptable and true otherwise
      • getExpectedRecords

        public long getExpectedRecords()
        Get the expected number of records for each token of this predicate. This tweaks the behavior of this predicate when run against an index scan. In particular, this informs how much memory to use for internal data structures as part of the scan. If the number provided is larger than the number that actually gets read, then the scan is less memory efficient. If the number provided is smaller than the number that actually gets read, then the scan may have more false positives than expected.
        Returns:
        the expected number of insertions per child of
      • getFalsePositivePercentage

        public double getFalsePositivePercentage()
        Get the configured false positive percentage for each token scan of this predicate. This is used, along with getExpectedRecords(), determines the size of internal data structures used as part of the scan. In general, the lower this number, the more memory is used. This number refers to the false positive percentage of determining if an individual prefix is in the indexed text field of a record while scanning.
        Returns:
        the rate of false positives used by probabilistic data structures
      • planHash

        public int planHash​(@Nonnull
                            PlanHashable.PlanHashKind hashKind)
        Description copied from interface: PlanHashable
        Return a hash similar to hashCode, but with the additional guarantee that is is stable across JVMs.
        Specified by:
        planHash in interface PlanHashable
        Overrides:
        planHash in class Comparisons.TextComparison
        Parameters:
        hashKind - the "kind" of hash to calculate. Each kind of hash has a particular logic with regards to included and excluded items.
        Returns:
        a stable hash code