org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment
Direct Known Subclasses:
JLHScore, NXYSignificanceHeuristic, PercentageScore, ScriptHeuristic

public abstract class SignificanceHeuristic extends implements NamedWriteable, org.elasticsearch.common.xcontent.ToXContentFragment
Heuristic for that SignificantTerms uses to pick out significant terms.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    checkFrequencyValidity​(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize,  scoreFunctionName)
     
    abstract double
    getScore​(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
     
    Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on the coordinating node.
    Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.

    Methods inherited from class java.lang.

    , , , , , , , , , ,

    Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable

    getWriteableName

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent

    toXContent

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment

    Methods inherited from interface org.elasticsearch.common.io.stream.Writeable

    writeTo
  • Constructor Details

    • SignificanceHeuristic

      public SignificanceHeuristic()
  • Method Details

    • 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,  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(AggregationContext context)
      Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.
      Parameters:
      context - the shard context on the data node
      Returns:
      a version of this heuristic suitable for execution