Module org.elasticsearch.server
Class JLHScore
java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.JLHScore
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoublegetScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Calculates the significance of a term in a sample against a background of normal distributions by comparing the changes in frequency.Returns the name of the writeable objectinthashCode()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
checkFrequencyValidity, rewrite, rewriteMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
PARSER
-
-
Constructor Details
-
JLHScore
public JLHScore() -
JLHScore
Read from a stream.
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteableReturns the name of the writeable object -
getScore
public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Calculates the significance of a term in a sample against a background of normal distributions by comparing the changes in frequency. This is the heart of the significant terms feature.- Specified by:
getScorein classSignificanceHeuristic- Parameters:
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)- Returns:
- a "significance" score
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-