当前位置: 首页>>代码示例>>C#>>正文


C# Searcher.GetSimilarity方法代码示例

本文整理汇总了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();
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:9,代码来源:Query.cs

示例2: MatchAllDocsWeight

			public MatchAllDocsWeight(MatchAllDocsQuery enclosingInstance, Searcher searcher)
			{
				InitBlock(enclosingInstance);
				this.similarity = searcher.GetSimilarity();
			}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:5,代码来源:MatchAllDocsQuery.cs

示例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));
     }
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:10,代码来源:DisjunctionMaxQuery.cs

示例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));
			}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:10,代码来源:DisjunctionMaxQuery.cs

示例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;
		}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:20,代码来源:QueryUtils.cs

示例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));
                }
			}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:12,代码来源:DisjunctionMaxQuery.cs


注:本文中的Lucene.Net.Search.Searcher.GetSimilarity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。