public abstract class SignificanceHeuristic extends java.lang.Object implements NamedWriteable, ToXContent
SignificantTerms
uses to pick out significant terms.Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
SignificanceHeuristic() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkFrequencyValidity(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize,
java.lang.String scoreFunctionName) |
abstract double |
getScore(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize) |
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.
|
SignificanceHeuristic |
rewrite(SearchContext context)
Provides a hook for subclasses to provide a version of the heuristic
prepared for execution on data on a shard.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getWriteableName
isFragment, toXContent
public abstract double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
subsetFreq
- The frequency of the term in the selected samplesubsetSize
- The size of the selected sample (typically number of docs)supersetFreq
- The frequency of the term in the superset from which the sample was takensupersetSize
- The size of the superset from which the sample was taken (typically number of docs)protected void checkFrequencyValidity(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize, java.lang.String scoreFunctionName)
public SignificanceHeuristic rewrite(InternalAggregation.ReduceContext reduceContext)
reduceContext
- the reduce context on the coordinating nodepublic SignificanceHeuristic rewrite(SearchContext context)
context
- the search context on the data node