public class ScriptHeuristic extends SignificanceHeuristic
Modifier and Type | Class and Description |
---|---|
class |
ScriptHeuristic.LongAccessor |
static class |
ScriptHeuristic.ScriptHeuristicBuilder |
static class |
ScriptHeuristic.ScriptHeuristicParser |
Modifier and Type | Field and Description |
---|---|
protected static ParseField |
NAMES_FIELD |
static SignificanceHeuristicStreams.Stream |
STREAM |
Constructor and Description |
---|
ScriptHeuristic(ExecutableScript searchScript,
String scriptLang,
String scriptString,
ScriptService.ScriptType scriptType,
Map<String,Object> params) |
Modifier and Type | Method and Description |
---|---|
double |
getScore(long subsetFreq,
long subsetSize,
long supersetFreq,
long supersetSize)
Calculates score with a script
|
void |
initialize(InternalAggregation.ReduceContext context) |
void |
writeTo(StreamOutput out) |
checkFrequencyValidity
protected static final ParseField NAMES_FIELD
public static final SignificanceHeuristicStreams.Stream STREAM
public ScriptHeuristic(ExecutableScript searchScript, String scriptLang, String scriptString, ScriptService.ScriptType scriptType, Map<String,Object> params)
public void initialize(InternalAggregation.ReduceContext context)
initialize
in class SignificanceHeuristic
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 void writeTo(StreamOutput out) throws IOException
writeTo
in class SignificanceHeuristic
IOException
Copyright © 2009–2015. All rights reserved.