Package org.apache.solr.schema
Class SimilarityFactory
- java.lang.Object
-
- org.apache.solr.schema.SimilarityFactory
-
- Direct Known Subclasses:
BM25SimilarityFactory
,BooleanSimilarityFactory
,ClassicSimilarityFactory
,DFISimilarityFactory
,DFRSimilarityFactory
,IBSimilarityFactory
,LMDirichletSimilarityFactory
,LMJelinekMercerSimilarityFactory
,SchemaSimilarityFactory
public abstract class SimilarityFactory extends Object
A factory interface for configuring aSimilarity
in the Solr schema.xml.Subclasses of
SimilarityFactory
which areSchemaAware
must take responsibility for either consulting the similarities configured on individual field types, or generating appropriate error/warning messages if field type specific similarities exist but are being ignored. TheIndexSchema
will provide such error checking if a non-SchemaAware
instance ofSimilarityFactory
is used.- See Also:
FieldType.getSimilarity()
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASS_NAME
protected SolrParams
params
-
Constructor Summary
Constructors Constructor Description SimilarityFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getClassArg()
SimpleOrderedMap<Object>
getNamedPropertyValues()
Returns a serializable description of this similarity(factory)SolrParams
getParams()
abstract org.apache.lucene.search.similarities.Similarity
getSimilarity()
void
init(SolrParams params)
-
-
-
Field Detail
-
CLASS_NAME
public static final String CLASS_NAME
- See Also:
- Constant Field Values
-
params
protected SolrParams params
-
-
Method Detail
-
init
public void init(SolrParams params)
-
getParams
public SolrParams getParams()
-
getSimilarity
public abstract org.apache.lucene.search.similarities.Similarity getSimilarity()
-
getNamedPropertyValues
public SimpleOrderedMap<Object> getNamedPropertyValues()
Returns a serializable description of this similarity(factory)
-
getClassArg
public String getClassArg()
- Returns:
- the string used to specify the concrete class name in a serialized representation: the
class arg. If the concrete class name was not specified via a class arg, returns
getClass().getName()
, unless this class is the anonymous similarity wrapper produced inIndexSchema
, in which case thegetSimilarity().getClass().getName()
is returned.
-
-