Module org.elasticsearch.server
Class PercentageScore
java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.PercentageScore
- All Implemented Interfaces:
- NamedWriteable,- Writeable,- ToXContent,- ToXContentFragment
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContentToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ObjectParser<PercentageScore,Void> Fields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleandoublegetScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Indicates the significance of a term in a sample by determining what percentage of all occurrences of a term are found in the sample.Returns the name of the writeable objectinthashCode()static SignificanceHeuristicparse(XContentParser parser) 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.SignificanceHeuristiccheckFrequencyValidity, rewrite, rewriteMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragmentisFragment
- 
Field Details- 
NAME- See Also:
 
- 
PARSER
 
- 
- 
Constructor Details- 
PercentageScorepublic PercentageScore()
- 
PercentageScore
 
- 
- 
Method Details- 
writeToDescription copied from interface:WriteableWrite this into the StreamOutput.- Throws:
- IOException
 
- 
getWriteableNameDescription copied from interface:NamedWriteableReturns the name of the writeable object
- 
toXContentpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
- IOException
 
- 
parsepublic static SignificanceHeuristic parse(XContentParser parser) throws IOException, QueryShardException - Throws:
- IOException
- QueryShardException
 
- 
getScorepublic double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Indicates the significance of a term in a sample by determining what percentage of all occurrences of a term are found in the sample.- Specified by:
- getScorein class- SignificanceHeuristic
- 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
 
- 
equals
- 
hashCodepublic int hashCode()
 
-