Class SimilarityService
java.lang.Object
org.elasticsearch.index.AbstractIndexComponent
org.elasticsearch.index.similarity.SimilarityService
- All Implemented Interfaces:
IndexComponent
-
Field Summary
Modifier and TypeFieldDescriptionstatic Map<String,TriFunction<Settings,Version,ScriptService,org.apache.lucene.search.similarities.Similarity>>
static String
Fields inherited from class org.elasticsearch.index.AbstractIndexComponent
indexSettings, logger
-
Constructor Summary
ConstructorDescriptionSimilarityService(IndexSettings indexSettings, ScriptService scriptService, Map<String,TriFunction<Settings,Version,ScriptService,org.apache.lucene.search.similarities.Similarity>> similarities)
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.similarities.Similarity
The default similarity configured in the index settings.getSimilarity(String name)
org.apache.lucene.search.similarities.Similarity
similarity(Function<String,MappedFieldType> fieldTypeLookup)
The similarity to use in searches, which takes into account per-field configuration.Methods inherited from class org.elasticsearch.index.AbstractIndexComponent
getIndexSettings, index
-
Field Details
-
DEFAULT_SIMILARITY
- See Also:
- Constant Field Values
-
BUILT_IN
public static final Map<String,TriFunction<Settings,Version,ScriptService,org.apache.lucene.search.similarities.Similarity>> BUILT_IN
-
-
Constructor Details
-
SimilarityService
public SimilarityService(IndexSettings indexSettings, ScriptService scriptService, Map<String,TriFunction<Settings,Version,ScriptService,org.apache.lucene.search.similarities.Similarity>> similarities)
-
-
Method Details
-
similarity
public org.apache.lucene.search.similarities.Similarity similarity(@Nullable Function<String,MappedFieldType> fieldTypeLookup)The similarity to use in searches, which takes into account per-field configuration. -
getSimilarity
-
getDefaultSimilarity
public org.apache.lucene.search.similarities.Similarity getDefaultSimilarity()The default similarity configured in the index settings.
-