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


C# Mono.Lucene.Net.Index.IndexReader.TermDocs方法代码示例

本文整理汇总了C#中Mono.Lucene.Net.Index.IndexReader.TermDocs方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.Lucene.Net.Index.IndexReader.TermDocs方法的具体用法?C# Mono.Lucene.Net.Index.IndexReader.TermDocs怎么用?C# Mono.Lucene.Net.Index.IndexReader.TermDocs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Lucene.Net.Index.IndexReader的用法示例。


在下文中一共展示了Mono.Lucene.Net.Index.IndexReader.TermDocs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MatchAllScorer

			internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity, Weight w, byte[] norms):base(similarity)
			{
				InitBlock(enclosingInstance);
				this.termDocs = reader.TermDocs(null);
				score = w.GetValue();
				this.norms = norms;
			}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:MatchAllDocsQuery.cs

示例2: Scorer

			public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
			{
				TermDocs termDocs = reader.TermDocs(Enclosing_Instance.term);
				
				if (termDocs == null)
					return null;
				
				return new TermScorer(this, termDocs, similarity, reader.Norms(Enclosing_Instance.term.Field()));
			}
开发者ID:carrie901,项目名称:mono,代码行数:9,代码来源:TermQuery.cs

示例3: Generate

            public virtual void Generate(MultiTermQuery query, IndexReader reader, TermEnum enumerator)
			{
				int[] docs = new int[32];
				int[] freqs = new int[32];
				TermDocs termDocs = reader.TermDocs();
				try
				{
					int termCount = 0;
					do 
					{
						Term term = enumerator.Term();
						if (term == null)
							break;
						termCount++;
						termDocs.Seek(term);
						while (true)
						{
							int count = termDocs.Read(docs, freqs);
							if (count != 0)
							{
								for (int i = 0; i < count; i++)
								{
									HandleDoc(docs[i]);
								}
							}
							else
							{
								break;
							}
						}
					}
					while (enumerator.Next());
					
					query.IncTotalNumberOfTerms(termCount); // {{Aroush-2.9}} is the use of 'temp' as is right?
				}
				finally
				{
					termDocs.Close();
				}
			}
开发者ID:carrie901,项目名称:mono,代码行数:40,代码来源:MultiTermQueryWrapperFilter.cs

示例4: ValueSourceScorer

			// constructor
			internal ValueSourceScorer(ValueSourceQuery enclosingInstance, Similarity similarity, IndexReader reader, ValueSourceWeight w):base(similarity)
			{
				InitBlock(enclosingInstance);
				this.weight = w;
				this.qWeight = w.GetValue();
				// this is when/where the values are first created.
				vals = Enclosing_Instance.valSrc.GetValues(reader);
				termDocs = reader.TermDocs(null);
			}
开发者ID:carrie901,项目名称:mono,代码行数:10,代码来源:ValueSourceQuery.cs

示例5: CreateValue

			protected internal override System.Object CreateValue(IndexReader reader, Entry entryKey)
			{
				System.String field = StringHelper.Intern((System.String) entryKey.field);
				int[] retArray = new int[reader.MaxDoc()];
				System.String[] mterms = new System.String[reader.MaxDoc() + 1];
				TermDocs termDocs = reader.TermDocs();
				TermEnum termEnum = reader.Terms(new Term(field));
				int t = 0; // current term number
				
				// an entry for documents that have no terms in this field
				// should a document with no terms be at top or bottom?
				// this puts them at the top - if it is changed, FieldDocSortedHitQueue
				// needs to change as well.
				mterms[t++] = null;
				
				try
				{
					do 
					{
						Term term = termEnum.Term();
                        if (term == null || term.Field() != field || t >= mterms.Length) break;
						
						// store term text
						mterms[t] = term.Text();
						
						termDocs.Seek(termEnum);
						while (termDocs.Next())
						{
							retArray[termDocs.Doc()] = t;
						}
						
						t++;
					}
					while (termEnum.Next());
				}
				finally
				{
					termDocs.Close();
					termEnum.Close();
				}
				
				if (t == 0)
				{
					// if there are no terms, make the term array
					// have a single null entry
					mterms = new System.String[1];
				}
				else if (t < mterms.Length)
				{
					// if there are less terms than documents,
					// trim off the dead array space
					System.String[] terms = new System.String[t];
					Array.Copy(mterms, 0, terms, 0, t);
					mterms = terms;
				}
				
				StringIndex value_Renamed = new StringIndex(retArray, mterms);
				return value_Renamed;
			}
开发者ID:carrie901,项目名称:mono,代码行数:59,代码来源:FieldCacheImpl.cs


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