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) |
checkFrequencyValidityprotected 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 SignificanceHeuristicpublic 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 void writeTo(StreamOutput out) throws IOException
writeTo in class SignificanceHeuristicIOExceptionCopyright © 2009–2016. All rights reserved.