Class JLHScore
java.lang.Object
org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.significant.heuristics.JLHScore
- All Implemented Interfaces:
NamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
public class JLHScore extends SignificanceHeuristic
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JLHScore.JLHScoreBuilder
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
static ObjectParser<JLHScore,java.lang.Void>
PARSER
-
Constructor Summary
Constructors Constructor Description JLHScore()
JLHScore(StreamInput in)
Read from a stream. -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
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.java.lang.String
getWriteableName()
Returns the name of the writeable objectint
hashCode()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic
checkFrequencyValidity, rewrite, rewrite
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
PARSER
-
-
Constructor Details
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String getWriteableName()Description copied from interface:NamedWriteable
Returns 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:
getScore
in 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 java.io.IOException- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-