Package org.elasticsearch.script
Class SimilarityScript
java.lang.Object
org.elasticsearch.script.SimilarityScript
public abstract class SimilarityScript
extends java.lang.Object
A script that is used to build
ScriptedSimilarity
instances.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SimilarityScript.Factory
-
Field Summary
Fields Modifier and Type Field Description static ScriptContext<SimilarityScript.Factory>
CONTEXT
static java.lang.String[]
PARAMETERS
-
Constructor Summary
Constructors Constructor Description SimilarityScript()
-
Method Summary
Modifier and Type Method Description abstract double
execute(double weight, ScriptedSimilarity.Query query, ScriptedSimilarity.Field field, ScriptedSimilarity.Term term, ScriptedSimilarity.Doc doc)
Compute the score.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
PARAMETERS
public static final java.lang.String[] PARAMETERS -
CONTEXT
-
-
Constructor Details
-
SimilarityScript
public SimilarityScript()
-
-
Method Details
-
execute
public abstract double execute(double weight, ScriptedSimilarity.Query query, ScriptedSimilarity.Field field, ScriptedSimilarity.Term term, ScriptedSimilarity.Doc doc)Compute the score.- Parameters:
weight
- weight computed by theSimilarityWeightScript
if any, or 1.query
- scoring factors that come from the queryfield
- field-level statisticsterm
- term-level statisticsdoc
- per-document statistics
-