Module org.elasticsearch.server
Class ScriptHeuristic
java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
org.elasticsearch.search.aggregations.bucket.terms.heuristic.ScriptHeuristic
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ConstructingObjectParser<ScriptHeuristic, Void> Fields 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 score with a scriptReturns the name of the writeable objectinthashCode()rewrite(AggregationReduceContext context) Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on the coordinating node.rewrite(AggregationContext context) Provides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.toXContent(XContentBuilder builder, ToXContent.Params builderParams) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic
checkFrequencyValidityMethods 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
-
ScriptHeuristic
-
ScriptHeuristic
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
rewrite
Description copied from class:SignificanceHeuristicProvides a hook for subclasses to provide a version of the heuristic prepared for execution on data on the coordinating node.- Overrides:
rewritein classSignificanceHeuristic- Parameters:
context- the reduce context on the coordinating node- Returns:
- a version of this heuristic suitable for execution
-
rewrite
Description copied from class:SignificanceHeuristicProvides a hook for subclasses to provide a version of the heuristic prepared for execution on data on a shard.- Overrides:
rewritein classSignificanceHeuristic- Parameters:
context- the shard context on the data node- Returns:
- a version of this heuristic suitable for execution
-
getScore
public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize) Calculates score with a script- 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
-
getWriteableName
Description copied from interface:NamedWriteableReturns the name of the writeable object -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params builderParams) throws IOException - Throws:
IOException
-
hashCode
public int hashCode() -
equals
-