本文整理汇总了C#中Lucene.Net.Index.TermEnum.Term方法的典型用法代码示例。如果您正苦于以下问题:C# TermEnum.Term方法的具体用法?C# TermEnum.Term怎么用?C# TermEnum.Term使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.TermEnum
的用法示例。
在下文中一共展示了TermEnum.Term方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getPositions
private TermPositions postings; // use getPositions()
#endregion Fields
#region Constructors
internal SegmentMergeInfo(int b, TermEnum te, IndexReader r)
{
base_Renamed = b;
reader = r;
termEnum = te;
term = te.Term();
}
示例2: Seek
public virtual void Seek(TermEnum termEnum)
{
TermInfo ti;
// use comparison of fieldinfos to verify that termEnum belongs to the same segment as this SegmentTermDocs
if (termEnum is SegmentTermEnum && ((SegmentTermEnum) termEnum).fieldInfos == parent.fieldInfos)
// optimized case
ti = ((SegmentTermEnum) termEnum).TermInfo();
// punt case
else
ti = parent.tis.Get(termEnum.Term());
Seek(ti);
}
示例3: Seek
public virtual void Seek(TermEnum termEnum)
{
TermInfo ti;
Term term;
// use comparison of fieldinfos to verify that termEnum belongs to the same segment as this SegmentTermDocs
if (termEnum is SegmentTermEnum && ((SegmentTermEnum) termEnum).fieldInfos == parent.core.fieldInfos)
{
// optimized case
SegmentTermEnum segmentTermEnum = ((SegmentTermEnum) termEnum);
term = segmentTermEnum.Term();
ti = segmentTermEnum.TermInfo();
}
else
{
// punt case
term = termEnum.Term();
ti = parent.core.GetTermsReader().Get(term);
}
Seek(ti, term);
}
示例4: Seek
public virtual void Seek(TermEnum termEnum)
{
Seek(termEnum.Term());
}
示例5: 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
}
示例6: 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
}
示例7: Seek
public virtual void Seek(TermEnum termEnum)
{
Seek(termEnum.Term());
if (termEnum is MultiTermEnum)
{
tenum = (MultiTermEnum) termEnum;
if (topReader != tenum.topReader)
tenum = null;
}
}
示例8: 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
}
示例9: 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
}