Class SignificanceHeuristic

    • Constructor Detail

      • SignificanceHeuristic

        public SignificanceHeuristic()
    • Method Detail

      • getScore

        public abstract double getScore​(long subsetFreq,
                                        long subsetSize,
                                        long supersetFreq,
                                        long supersetSize)
        Parameters:
        subsetFreq - The frequency of the term in the selected sample
        subsetSize - The size of the selected sample (typically number of docs)
        supersetFreq - The frequency of the term in the superset from which the sample was taken
        supersetSize - The size of the superset from which the sample was taken (typically number of docs)
        Returns:
        a "significance" score
      • checkFrequencyValidity

        protected void checkFrequencyValidity​(long subsetFreq,
                                              long subsetSize,
                                              long supersetFreq,
                                              long supersetSize,
                                              java.lang.String scoreFunctionName)
      • rewrite

        public SignificanceHeuristic rewrite​(InternalAggregation.ReduceContext reduceContext)
        Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on the coordinating node.
        Parameters:
        reduceContext - the reduce context on the coordinating node
        Returns:
        a version of this heuristic suitable for execution
      • rewrite

        public SignificanceHeuristic rewrite​(SearchContext context)
        Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.
        Parameters:
        context - the search context on the data node
        Returns:
        a version of this heuristic suitable for execution