Table of Contents

Class IndexSimilarityCollection

Namespace
Examine.Lucene
Assembly
Examine.Lucene.dll

Maintains a collection of field names names and their IIndexSimilarityType for an index

public class IndexSimilarityCollection
Inheritance
IndexSimilarityCollection
Inherited Members

Constructors

IndexSimilarityCollection(IReadOnlyDictionary<string, ISimilarityTypeFactory>, string, ReadOnlySimilarityDefinitionCollection)

public IndexSimilarityCollection(IReadOnlyDictionary<string, ISimilarityTypeFactory> valueTypeFactories, string defaultSimilarityName, ReadOnlySimilarityDefinitionCollection similarityDefinitionCollection)

Parameters

valueTypeFactories IReadOnlyDictionary<string, ISimilarityTypeFactory>

List of value type factories to initialize the collection with

defaultSimilarityName string

Name of the default Similarity

similarityDefinitionCollection ReadOnlySimilarityDefinitionCollection

Properties

DefaultSimilarityName

Name of the Similarity to use by default for searches

public string DefaultSimilarityName { get; }

Property Value

string

IndexSimilarityFactories

Defines the field types such as number, fulltext, etc...

public SimilarityFactoryCollection IndexSimilarityFactories { get; }

Property Value

SimilarityFactoryCollection

Similarities

Returns the resolved collection of IIndexSimilarityType for this index

public IEnumerable<IIndexSimilarityType> Similarities { get; }

Property Value

IEnumerable<IIndexSimilarityType>

Methods

GetIndexSimilarity(string)

Returns the value type for the similarity name specified

public IIndexSimilarityType GetIndexSimilarity(string similarityName)

Parameters

similarityName string

Returns

IIndexSimilarityType

Exceptions

InvalidOperationException

Throws an exception if a similarity type was not found

GetIndexSimilarity(string, ISimilarityTypeFactory)

Returns the IIndexSimilarityType for the similarity name specified

public IIndexSimilarityType GetIndexSimilarity(string similarityName, ISimilarityTypeFactory similarityFactory)

Parameters

similarityName string
similarityFactory ISimilarityTypeFactory

Returns

IIndexSimilarityType

Remarks

If it's not found it will create one with the factory supplied and initialize it.