Lucene.Net.Search.Similarity.Coord C# (CSharp) Method

Coord() public abstract method

Computes a score factor based on the fraction of all query terms that a document contains. This value is multiplied into scores.

The presence of a large portion of the query terms indicates a better match with the query, so implementations of this method usually return larger values when the ratio between these parameters is large and smaller values when the ratio between them is small.

public abstract Coord ( int overlap, int maxOverlap ) : float
overlap int the number of query terms matched in the document ///
maxOverlap int the total number of terms in the query ///
return float
		public abstract float Coord(int overlap, int maxOverlap);
		

Usage Example

コード例 #1
0
 public virtual float Coord(int overlap, int maxOverlap)
 {
     // LUCENE-4300: in most cases of maxOverlap=1, BQ rewrites itself away,
     // so coord() is not applied. But when BQ cannot optimize itself away
     // for a single clause (minNrShouldMatch, prohibited clauses, etc), its
     // important not to apply coord(1,1) for consistency, it might not be 1.0F
     return(maxOverlap == 1 ? 1F : similarity.Coord(overlap, maxOverlap));
 }
All Usage Examples Of Lucene.Net.Search.Similarity::Coord