Class MultiSimilarity
Implements the CombSUM method for combining evidence from multiple similarity values described in: Joseph A. Shaw, Edward A. Fox. In Text REtrieval Conference (1993), pp. 243-252
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Search.Similarities
Assembly: Lucene.Net.dll
Syntax
public class MultiSimilarity : Similarity
Constructors
MultiSimilarity(Similarity[])
Creates a MultiSimilarity which will sum the scores
of the provided sims.
Declaration
public MultiSimilarity(Similarity[] sims)
Parameters
| Type | Name | Description |
|---|---|---|
| Similarity[] | sims |
Fields
m_sims
the sub-similarities used to create the combined score
Declaration
protected readonly Similarity[] m_sims
Field Value
| Type | Description |
|---|---|
| Similarity[] |
Methods
ComputeNorm(FieldInvertState)
Computes the normalization value for a field, given the accumulated state of term processing for this field (see FieldInvertState).
Matches in longer fields are less precise, so implementations of this method usually set smaller values whenstate.Length is large,
and larger values when state.Length is small.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public override long ComputeNorm(FieldInvertState state)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInvertState | state | current processing state for this field |
Returns
| Type | Description |
|---|---|
| long | computed norm value |
Overrides
ComputeWeight(float, CollectionStatistics, params TermStatistics[])
Compute any collection-level weight (e.g. IDF, average document length, etc) needed for scoring a query.
Declaration
public override Similarity.SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
Parameters
| Type | Name | Description |
|---|---|---|
| float | queryBoost | the query-time boost. |
| CollectionStatistics | collectionStats | collection-level statistics, such as the number of tokens in the collection. |
| TermStatistics[] | termStats | term-level statistics, such as the document frequency of a term across the collection. |
Returns
| Type | Description |
|---|---|
| Similarity.SimWeight | Similarity.SimWeight object with the information this Similarity needs to score a query. |
Overrides
GetSimScorer(SimWeight, AtomicReaderContext)
Creates a new Similarity.SimScorer to score matching documents from a segment of the inverted index.
Declaration
public override Similarity.SimScorer GetSimScorer(Similarity.SimWeight stats, AtomicReaderContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| Similarity.SimWeight | stats | |
| AtomicReaderContext | context | segment of the inverted index to be scored. |
Returns
| Type | Description |
|---|---|
| Similarity.SimScorer | Sloppy Similarity.SimScorer for scoring documents across |
Overrides
Exceptions
| Type | Condition |
|---|---|
| IOException | if there is a low-level I/O error |