public class ScriptHeuristic extends SignificanceHeuristic
| Modifier and Type | Class and Description |
|---|---|
class |
ScriptHeuristic.LongAccessor |
Writeable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
EMPTY_PARAMS| Constructor and Description |
|---|
ScriptHeuristic(Script script) |
ScriptHeuristic(StreamInput in)
Read from a stream.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
double |
getScore(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize)
Calculates score with a script
|
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
int |
hashCode() |
static SignificanceHeuristic |
parse(QueryParseContext context) |
SignificanceHeuristic |
rewrite(InternalAggregation.ReduceContext context)
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.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params builderParams) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
checkFrequencyValidityclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisFragmentpublic static final java.lang.String NAME
public ScriptHeuristic(Script script)
public ScriptHeuristic(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
Writeablejava.io.IOExceptionpublic SignificanceHeuristic rewrite(InternalAggregation.ReduceContext context)
SignificanceHeuristicrewrite in class SignificanceHeuristiccontext - the reduce context on the coordinating nodepublic SignificanceHeuristic rewrite(SearchContext context)
SignificanceHeuristicrewrite in class SignificanceHeuristiccontext - the search context on the data nodepublic double getScore(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize)
getScore in class SignificanceHeuristicsubsetFreq - 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)public java.lang.String getWriteableName()
NamedWriteablepublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params builderParams) throws java.io.IOException
java.io.IOExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static SignificanceHeuristic parse(QueryParseContext context) throws java.io.IOException, QueryShardException
java.io.IOExceptionQueryShardException