本文整理汇总了C#中Lucene.Net.Search.Searcher.GetSimilarity方法的典型用法代码示例。如果您正苦于以下问题:C# Searcher.GetSimilarity方法的具体用法?C# Searcher.GetSimilarity怎么用?C# Searcher.GetSimilarity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.Searcher
的用法示例。
在下文中一共展示了Searcher.GetSimilarity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSimilarity
/// <summary>Expert: Returns the Similarity implementation to be used for this query.
/// Subclasses may override this method to specify their own Similarity
/// implementation, perhaps one that delegates through that of the Searcher.
/// By default the Searcher's Similarity implementation is returned.
/// </summary>
public virtual Similarity GetSimilarity(Searcher searcher)
{
return searcher.GetSimilarity();
}
示例2: MatchAllDocsWeight
public MatchAllDocsWeight(MatchAllDocsQuery enclosingInstance, Searcher searcher)
{
InitBlock(enclosingInstance);
this.similarity = searcher.GetSimilarity();
}
示例3: DisjunctionMaxWeight
/* Construct the Weight for this Query searched by searcher. Recursively construct subquery weights. */
public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
{
InitBlock(enclosingInstance);
this.similarity = searcher.GetSimilarity();
for (System.Collections.IEnumerator iter = Enclosing_Instance.disjuncts.GetEnumerator(); iter.MoveNext(); )
{
weights.Add(((Query) iter.Current).CreateWeight(searcher));
}
}
示例4: DisjunctionMaxWeight
private System.Collections.ArrayList weights = new System.Collections.ArrayList(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts
/* Construct the Weight for this Query searched by searcher. Recursively construct subquery weights. */
public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
{
InitBlock(enclosingInstance);
this.similarity = searcher.GetSimilarity();
for (int i = 0; i < Enclosing_Instance.disjuncts.Count; i++)
weights.Add(((Query) Enclosing_Instance.disjuncts[i]).CreateWeight(searcher));
}
示例5: WrapSearcher
/// <summary> Given a Searcher, returns a new MultiSearcher wrapping the
/// the original Searcher,
/// as well as several "empty" IndexSearchers -- some of which will have
/// deleted documents in them. This new MultiSearcher
/// should behave exactly the same as the original Searcher.
/// </summary>
/// <param name="s">the Searcher to wrap
/// </param>
/// <param name="edge">if negative, s will be the first sub; if 0, s will be in hte middle, if positive s will be the last sub
/// </param>
public static MultiSearcher WrapSearcher(Searcher s, int edge)
{
// we can't put deleted docs before the nested reader, because
// it will through off the docIds
Searcher[] searchers = new Searcher[]{edge < 0?s:new IndexSearcher(MakeEmptyIndex(0)), new MultiSearcher(new Searcher[]{new IndexSearcher(MakeEmptyIndex(edge < 0?65:0)), new IndexSearcher(MakeEmptyIndex(0)), 0 == edge?s:new IndexSearcher(MakeEmptyIndex(0))}), new IndexSearcher(MakeEmptyIndex(0 < edge?0:3)), new IndexSearcher(MakeEmptyIndex(0)), new MultiSearcher(new Searcher[]{new IndexSearcher(MakeEmptyIndex(0 < edge?0:5)), new IndexSearcher(MakeEmptyIndex(0)), 0 < edge?s:new IndexSearcher(MakeEmptyIndex(0))})};
MultiSearcher out_Renamed = new MultiSearcher(searchers);
out_Renamed.SetSimilarity(s.GetSimilarity());
return out_Renamed;
}
示例6: DisjunctionMaxWeight
protected internal List<Weight> weights = new List<Weight>(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts
/* Construct the Weight for this Query searched by searcher. Recursively construct subquery weights. */
public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
{
InitBlock(enclosingInstance);
this.similarity = searcher.GetSimilarity();
foreach (Query query in Enclosing_Instance.disjuncts)
{
weights.Add(query.CreateWeight(searcher));
}
}