本文整理汇总了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
}
示例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
}
示例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
}
示例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
}
示例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
}