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


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

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


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

示例1: Bits

		public override System.Collections.BitArray Bits(IndexReader reader)
		{
			System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
			
			new IndexSearcher(reader).Search(query, new AnonymousClassHitCollector(bits, this));
			return bits;
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:7,代码来源:QueryWrapperFilter.cs

示例2: Bits

        public override System.Collections.BitArray Bits(IndexReader reader)
        {
            if (cache == null)
            {
                cache = new System.Collections.Hashtable();
            }

            lock (cache.SyncRoot)
            {
                // check cache
                System.Collections.BitArray cached = (System.Collections.BitArray) cache[reader];
                if (cached != null)
                {
                    return cached;
                }
            }

            System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);

            new IndexSearcher(reader).Search(query, new AnonymousClassHitCollector(bits, this));

            lock (cache.SyncRoot)
            {
                // update cache
                cache[reader] = bits;
            }

            return bits;
        }
开发者ID:karino2,项目名称:wikipediaconv,代码行数:29,代码来源:QueryFilter.cs

示例3: Bits

		public override System.Collections.BitArray Bits(IndexReader reader)
		{
			System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);

			for (int increment = 0; doc >= bits.Length; increment =+ 64)
			{
				bits.Length += increment;
			}
			bits.Set(doc, true);
			
			return bits;
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:12,代码来源:SingleDocTestFilter.cs

示例4: Bits

 /// <summary> Returns a BitSet with true for documents which should be
 /// permitted in search results, and false for those that should
 /// not.
 /// </summary>
 /// <deprecated> Use {@link #GetDocIdSet(IndexReader)} instead.
 /// </deprecated>
 //@Override
 public override System.Collections.BitArray Bits(IndexReader reader)
 {
     TermEnum enumerator = query.GetEnum(reader);
     try
     {
         System.Collections.BitArray bitSet = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
         new AnonymousClassTermGenerator(bitSet, this).Generate(query, reader, enumerator);
         return bitSet;
     }
     finally
     {
         enumerator.Close();
     }
 }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:21,代码来源:MultiTermQueryWrapperFilter.cs

示例5: CreateValue

			protected internal override System.Object CreateValue(IndexReader reader, System.Object entryKey)
			{
				Entry entry = (Entry) entryKey;
				System.String field = entry.field;
				LongParser parser = (LongParser) entry.custom;
				long[] retArray = new long[reader.MaxDoc()];
				TermDocs termDocs = reader.TermDocs();
				TermEnum termEnum = reader.Terms(new Term(field, ""));
				try
				{
					do 
					{
						Term term = termEnum.Term();
						if (term == null || (System.Object) term.Field() != (System.Object) field)
							break;
						long termval = parser.ParseLong(term.Text());
						termDocs.Seek(termEnum);
						while (termDocs.Next())
						{
							retArray[termDocs.Doc()] = termval;
						}
					}
					while (termEnum.Next());
				}
				finally
				{
					termDocs.Close();
					termEnum.Close();
				}
				return retArray;
			}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:31,代码来源:ExtendedFieldCacheImpl.cs

示例6: MatchAllScorer

			internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity) : base(similarity)
			{
				InitBlock(enclosingInstance);
				this.reader = reader;
				count = - 1;
				maxDoc = reader.MaxDoc();
			}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:7,代码来源:MatchAllDocsQuery.cs

示例7: MatchAllScorer

			internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity, Weight w):base(similarity)
			{
				InitBlock(enclosingInstance);
				this.reader = reader;
				id = - 1;
				maxId = reader.MaxDoc() - 1;
				score = w.GetValue();
			}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:8,代码来源:MatchAllDocsQuery.cs

示例8: BitSpans

 public override SpanFilterResult BitSpans(IndexReader reader)
 {
     OpenBitSet bits = new OpenBitSet((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
     _Spans spans = query.GetSpans(reader);
     System.Collections.IList tmp = new System.Collections.ArrayList(20);
     int currentDoc = - 1;
     SpanFilterResult.PositionInfo currentInfo = null;
     while (spans.Next())
     {
         int doc = spans.Doc();
         bits.Set(doc);
         if (currentDoc != doc)
         {
             currentInfo = new SpanFilterResult.PositionInfo(doc);
             tmp.Add(currentInfo);
             currentDoc = doc;
         }
         currentInfo.AddPosition(spans.Start(), spans.End());
     }
     return new SpanFilterResult(bits, tmp);
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:21,代码来源:SpanQueryFilter.cs

示例9: BitSpans

		public override SpanFilterResult BitSpans(IndexReader reader)
		{
			
			OpenBitSet bits = new OpenBitSet(reader.MaxDoc());
			Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);
            List<SpanFilterResult.PositionInfo> tmp = new List<SpanFilterResult.PositionInfo>(20);
			int currentDoc = - 1;
			SpanFilterResult.PositionInfo currentInfo = null;
			while (spans.Next())
			{
				int doc = spans.Doc();
				bits.Set(doc);
				if (currentDoc != doc)
				{
					currentInfo = new SpanFilterResult.PositionInfo(doc);
					tmp.Add(currentInfo);
					currentDoc = doc;
				}
				currentInfo.AddPosition(spans.Start(), spans.End());
			}
			return new SpanFilterResult(bits, tmp);
		}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:22,代码来源:SpanQueryFilter.cs

示例10: GetDocIdSet

			public override DocIdSet GetDocIdSet(IndexReader reader)
			{
				System.Collections.BitArray bs = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
                for (int i = 0; i < reader.MaxDoc(); i++) bs.Set(i, true);
				bs.Set(docs1.ScoreDocs[0].Doc, true);
				return new DocIdBitSet(bs);
			}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:7,代码来源:TestSort.cs

示例11: Bits

		public override System.Collections.BitArray Bits(IndexReader reader)
		{
			System.Collections.BitArray bitSet = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
			new AnonymousClassPrefixGenerator(bitSet, this, prefix).Generate(reader);
			return bitSet;
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:6,代码来源:PrefixFilter.cs

示例12: ValueSourceScorer

 // constructor
 internal ValueSourceScorer(ValueSourceQuery enclosingInstance, Similarity similarity, IndexReader reader, ValueSourceWeight w)
     : base(similarity)
 {
     InitBlock(enclosingInstance);
     this.weight = w;
     this.qWeight = w.GetValue();
     this.reader = reader;
     this.maxDoc = reader.MaxDoc();
     // this is when/where the values are first created.
     vals = Enclosing_Instance.valSrc.GetValues(reader);
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:12,代码来源:ValueSourceQuery.cs

示例13: Bits

			public override System.Collections.BitArray Bits(IndexReader r)
			{
				System.Collections.BitArray b = new System.Collections.BitArray((r.MaxDoc() % 64 == 0?r.MaxDoc() / 64:r.MaxDoc() / 64 + 1) * 64);
				for (int i = 0; i < docs.Length; i++)
				{
					b.Set(docs[i], true);
				}
				return b;
			}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:9,代码来源:TestExplanations.cs

示例14: GetDocIdSet

 public override DocIdSet GetDocIdSet(IndexReader reader)
 {
     OpenBitSet bitSet = new OpenBitSet((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
     new AnonymousClassPrefixGenerator2(bitSet, this, prefix).Generate(reader);
     return bitSet;
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:6,代码来源:PrefixFilter.cs

示例15: CreateValue

 protected internal override System.Object CreateValue(IndexReader reader, Entry entryKey)
 {
     System.String field = StringHelper.Intern((System.String) entryKey.field);
     System.String[] retArray = new System.String[reader.MaxDoc()];
     TermDocs termDocs = reader.TermDocs();
     TermEnum termEnum = reader.Terms(new Term(field));
     try
     {
         do
         {
             Term term = termEnum.Term();
             if (term == null || (System.Object) term.Field() != (System.Object) field)
                 break;
             System.String termval = term.Text();
             termDocs.Seek(termEnum);
             while (termDocs.Next())
             {
                 retArray[termDocs.Doc()] = termval;
             }
         }
         while (termEnum.Next());
     }
     finally
     {
         termDocs.Close();
         termEnum.Close();
     }
     return retArray;
 }
开发者ID:andylaudotnet,项目名称:StockFoo,代码行数:29,代码来源:FieldCacheImpl.cs


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