public class ScriptHeuristic extends SignificanceHeuristic
Modifier and Type | Class and Description |
---|---|
class |
ScriptHeuristic.LongAccessor |
static class |
ScriptHeuristic.ScriptHeuristicBuilder |
Writeable.Reader<R>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static ParseField |
NAMES_FIELD |
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() |
void |
initialize(InternalAggregation.ReduceContext context) |
void |
initialize(ScriptService scriptService,
ClusterState state) |
void |
initialize(SearchContext context) |
static SignificanceHeuristic |
parse(XContentParser parser,
ParseFieldMatcher parseFieldMatcher) |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params builderParams) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
checkFrequencyValidity
public static final ParseField NAMES_FIELD
public ScriptHeuristic(Script script)
public ScriptHeuristic(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
java.io.IOException
public void initialize(InternalAggregation.ReduceContext context)
initialize
in class SignificanceHeuristic
public void initialize(SearchContext context)
initialize
in class SignificanceHeuristic
public void initialize(ScriptService scriptService, ClusterState state)
public double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
getScore
in class SignificanceHeuristic
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)public java.lang.String getWriteableName()
NamedWriteable
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params builderParams) throws java.io.IOException
java.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static SignificanceHeuristic parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws java.io.IOException, QueryShardException
java.io.IOException
QueryShardException