Class ScriptedSimilarity
java.lang.Object
org.apache.lucene.search.similarities.Similarity
org.elasticsearch.index.similarity.ScriptedSimilarity
public final class ScriptedSimilarity
extends org.apache.lucene.search.similarities.Similarity
A
Similarity
implementation that allows scores to be scripted.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Statistics that are specific to a document.static class
Statistics that are specific to a given field.static class
Scoring factors that come from the query.static class
Statistics that are specific to a given term.Nested classes/interfaces inherited from class org.apache.lucene.search.similarities.Similarity
org.apache.lucene.search.similarities.Similarity.SimScorer
-
Constructor Summary
ConstructorDescriptionScriptedSimilarity
(String weightScriptString, SimilarityWeightScript.Factory weightScriptFactory, String scriptString, SimilarityScript.Factory scriptFactory, boolean discountOverlaps) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionlong
computeNorm
(org.apache.lucene.index.FieldInvertState state) org.apache.lucene.search.similarities.Similarity.SimScorer
scorer
(float boost, org.apache.lucene.search.CollectionStatistics collectionStats, org.apache.lucene.search.TermStatistics... termStats) toString()
-
Constructor Details
-
ScriptedSimilarity
public ScriptedSimilarity(String weightScriptString, SimilarityWeightScript.Factory weightScriptFactory, String scriptString, SimilarityScript.Factory scriptFactory, boolean discountOverlaps) Sole constructor.
-
-
Method Details
-
toString
-
computeNorm
public long computeNorm(org.apache.lucene.index.FieldInvertState state) - Specified by:
computeNorm
in classorg.apache.lucene.search.similarities.Similarity
-
scorer
public org.apache.lucene.search.similarities.Similarity.SimScorer scorer(float boost, org.apache.lucene.search.CollectionStatistics collectionStats, org.apache.lucene.search.TermStatistics... termStats) - Specified by:
scorer
in classorg.apache.lucene.search.similarities.Similarity
-