當前位置: 首頁>>代碼示例>>C#>>正文


C# IndexReader.TermPositions方法代碼示例

本文整理匯總了C#中Transformalize.Libs.Lucene.Net.Index.IndexReader.TermPositions方法的典型用法代碼示例。如果您正苦於以下問題:C# IndexReader.TermPositions方法的具體用法?C# IndexReader.TermPositions怎麽用?C# IndexReader.TermPositions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transformalize.Libs.Lucene.Net.Index.IndexReader的用法示例。


在下文中一共展示了IndexReader.TermPositions方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetSpans

		public override Spans GetSpans(IndexReader reader)
		{
			return new TermSpans(reader.TermPositions(internalTerm), internalTerm);
		}
開發者ID:mindis,項目名稱:Transformalize,代碼行數:4,代碼來源:SpanTermQuery.cs

示例2: Scorer

			public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
			{
				if (Enclosing_Instance.terms.Count == 0)
				// optimize zero-term case
					return null;
				
				TermPositions[] tps = new TermPositions[Enclosing_Instance.terms.Count];
				for (int i = 0; i < Enclosing_Instance.terms.Count; i++)
				{
					TermPositions p = reader.TermPositions(Enclosing_Instance.terms[i]);
					if (p == null)
						return null;
					tps[i] = p;
				}
				
				if (Enclosing_Instance.slop == 0)
				// optimize exact case
					return new ExactPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), similarity, reader.Norms(Enclosing_Instance.field));
				else
					return new SloppyPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), similarity, Enclosing_Instance.slop, reader.Norms(Enclosing_Instance.field));
			}
開發者ID:mindis,項目名稱:Transformalize,代碼行數:21,代碼來源:PhraseQuery.cs

示例3: Scorer

			public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
			{
				if (Enclosing_Instance.termArrays.Count == 0)
				// optimize zero-term case
					return null;
				
				TermPositions[] tps = new TermPositions[Enclosing_Instance.termArrays.Count];
				for (int i = 0; i < tps.Length; i++)
				{
					Term[] terms = Enclosing_Instance.termArrays[i];
					
					TermPositions p;
					if (terms.Length > 1)
						p = new MultipleTermPositions(reader, terms);
					else
						p = reader.TermPositions(terms[0]);
					
					if (p == null)
						return null;
					
					tps[i] = p;
				}
				
				if (Enclosing_Instance.slop == 0)
					return new ExactPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), similarity, reader.Norms(Enclosing_Instance.field));
				else
					return new SloppyPhraseScorer(this, tps, Enclosing_Instance.GetPositions(), similarity, Enclosing_Instance.slop, reader.Norms(Enclosing_Instance.field));
			}
開發者ID:mindis,項目名稱:Transformalize,代碼行數:28,代碼來源:MultiPhraseQuery.cs

示例4: TermDocs

 protected internal override TermDocs TermDocs(IndexReader reader)
 {
     return reader.TermPositions();
 }
開發者ID:mindis,項目名稱:Transformalize,代碼行數:4,代碼來源:DirectoryReader.cs


注:本文中的Transformalize.Libs.Lucene.Net.Index.IndexReader.TermPositions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。