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


C# TermEnum.Close方法代码示例

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


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

示例1: Next

			public override bool Next()
			{
				if (termEnum == null)
					return false;
				
				// another term in this field?
				if (termEnum.Next() && (System.Object) termEnum.Term().Field() == (System.Object) field)
					return true; // yes, keep going
				
				termEnum.Close(); // close old termEnum
				
				// find the next field with terms, if any
				if (fieldIterator == null)
				{
                    System.Collections.Comparer comparer = System.Collections.Comparer.Default;
                    System.Collections.SortedList newList = new System.Collections.SortedList();
                    if (Enclosing_Instance.fieldToReader != null)
                    {
                        if (Enclosing_Instance.fieldToReader.Count > 0)
                        {
                            int index = 0;
                            while (comparer.Compare(Enclosing_Instance.fieldToReader.GetKey(index), field) < 0)
                                index++;
                            for (; index < Enclosing_Instance.fieldToReader.Count; index++)
                            {
                                newList.Add(Enclosing_Instance.fieldToReader.GetKey(index), Enclosing_Instance.fieldToReader[Enclosing_Instance.fieldToReader.GetKey(index)]);
                            }
                        }
                    }

                    fieldIterator = newList.Keys.GetEnumerator();
                    fieldIterator.MoveNext();
					System.Object generatedAux = fieldIterator.Current; // Skip field to get next one
				}
				while (fieldIterator.MoveNext())
				{
					field = ((System.String) fieldIterator.Current);
					termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms(new Term(field));
					Term term = termEnum.Term();
					if (term != null && (System.Object) term.Field() == (System.Object) field)
						return true;
					else
						termEnum.Close();
				}
				
				return false; // no more fields
			}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:47,代码来源:ParallelReader.cs

示例2: Next

			public override bool Next()
			{
				if (termEnum == null)
					return false;
				
				// another term in this field?
				if (termEnum.Next() && (System.Object) termEnum.Term.Field == (System.Object) field)
					return true; // yes, keep going
				
				termEnum.Close(); // close old termEnum
				
				// find the next field with terms, if any
				if (fieldIterator == null)
				{
                    var newList = new List<string>();  
                    if (Enclosing_Instance.fieldToReader != null && Enclosing_Instance.fieldToReader.Count > 0)
                    {
                        var comparer = Enclosing_Instance.fieldToReader.Comparer;
                        foreach(var entry in Enclosing_Instance.fieldToReader.Keys.Where(x => comparer.Compare(x, field) >= 0))
                            newList.Add(entry);
                    }

                    fieldIterator = newList.Skip(1).GetEnumerator(); // Skip field to get next one
				}
				while (fieldIterator.MoveNext())
				{
					field = fieldIterator.Current;
					termEnum = Enclosing_Instance.fieldToReader[field].Terms(new Term(field));
					Term term = termEnum.Term;
					if (term != null && (System.Object) term.Field == (System.Object) field)
						return true;
					else
						termEnum.Close();
				}
				
				return false; // no more fields
			}
开发者ID:modulexcite,项目名称:Xamarin-Lucene.Net,代码行数:37,代码来源:ParallelReader.cs

示例3: Next

			public override bool Next()
			{
				if (termEnum == null)
					return false;
				
				// another term in this field?
				if (termEnum.Next() && (System.Object) termEnum.Term().Field() == (System.Object) field)
					return true; // yes, keep going
				
				termEnum.Close(); // close old termEnum
				
				// find the next field with terms, if any
				if (fieldIterator == null)
				{
					fieldIterator = SupportClass.TailMap(Enclosing_Instance.fieldToReader, field).Keys.GetEnumerator();
                    fieldIterator.MoveNext();                     // Skip field to get next one
				}
				while (fieldIterator.MoveNext())
				{
					field = ((System.String) fieldIterator.Current);
					termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms(new Term(field, ""));
					Term term = termEnum.Term();
					if (term != null && (System.Object) term.Field() == (System.Object) field)
						return true;
					else
						termEnum.Close();
				}
				
				return false; // no more fields
			}
开发者ID:zweib730,项目名称:beagrep,代码行数:30,代码来源:ParallelReader.cs

示例4: Next

			public override bool Next()
			{
				if (termEnum == null)
					return false;
				
				// another term in this field?
				if (termEnum.Next() && (System.Object) termEnum.Term().Field() == (System.Object) field)
					return true; // yes, keep going
				
				termEnum.Close(); // close old termEnum
				
				// find the next field with terms, if any
				if (fieldIterator == null)
				{
                    List<string> tmpList = new List<string>();
                    bool m = false;
                    //JAVA: fieldIterator = fieldToReader.tailMap(field).keySet().iterator();
                    //JAVA: fieldIterator.next();  // Skip field to get next one
                    foreach (string key in Enclosing_Instance.fieldToReader.Keys)
                    {
                        if (key == field && m==false) m = true;
                        if (m) tmpList.Add(key);
                    }
                    fieldIterator = tmpList.GetEnumerator();
				}
				while (fieldIterator.MoveNext())
				{
					field =  fieldIterator.Current;
					termEnum = Enclosing_Instance.fieldToReader[field].Terms(new Term(field));
					Term term = termEnum.Term();
					if (term != null && (System.Object) term.Field() == (System.Object) field)
						return true;
					else
						termEnum.Close();
				}
				
				return false; // no more fields
			}
开发者ID:jhuntsman,项目名称:FlexNet,代码行数:38,代码来源:ParallelReader.cs

示例5: Next

            public override bool Next()
            {
                if (termEnum == null)
                    return false;

                // another term in this field?
                if (termEnum.Next() && (object) termEnum.Term().Field() == (object) field)
                    return true; // yes, keep going

                termEnum.Close(); // close old termEnum

                // find the next field with terms, if any
                if (fieldIterator == null)
                {
                    fieldIterator = SupportClass.CollectionsSupport.TailMap(Enclosing_Instance.fieldToReader, field).Keys.GetEnumerator();
                }
                while (fieldIterator.MoveNext())
                {
                    field = fieldIterator.Current;
                    termEnum = Enclosing_Instance.fieldToReader[field].Terms(new Term(field));
                    Term term = termEnum.Term();
                    if (term != null && (object) term.Field() == (object) field)
                        return true;
                    else
                        termEnum.Close();
                }

                return false; // no more fields
            }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:29,代码来源:ParallelReader.cs


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