本文整理汇总了C#中Lucene.Net.Index.TermEnum类的典型用法代码示例。如果您正苦于以下问题:C# TermEnum类的具体用法?C# TermEnum怎么用?C# TermEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TermEnum类属于Lucene.Net.Index命名空间,在下文中一共展示了TermEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SegmentMergeInfo
internal SegmentMergeInfo(int b, TermEnum te, IndexReader r)
{
base_Renamed = b;
reader = r;
termEnum = te;
term = te.Term;
}
开发者ID:modulexcite,项目名称:Xamarin-Lucene.Net,代码行数:7,代码来源:SegmentMergeInfo.cs
示例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);
}
开发者ID:zweib730,项目名称:beagrep,代码行数:14,代码来源:SegmentTermDocs.cs
示例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
var segmentTermEnum = ((SegmentTermEnum) termEnum);
term = segmentTermEnum.Term;
ti = segmentTermEnum.TermInfo();
}
else
{
// punt case
term = termEnum.Term;
ti = parent.core.GetTermsReader().Get(term);
}
Seek(ti, term);
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:22,代码来源:SegmentTermDocs.cs
示例4: FilterTermEnum
public FilterTermEnum(TermEnum in_Renamed)
{
this.in_Renamed = in_Renamed;
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:4,代码来源:FilterIndexReader.cs
示例5: IndexDirectory
private static void IndexDirectory(IndexWriter writer, TermEnum uidIter, DirectoryInfo dir, Operation operation) {
var entries = Directory.GetFileSystemEntries(dir.FullName);
// Sort the entries. This is important, the uidIter TermEnum is
// iterated in a forward-only fashion, requiring all files to be
// passed in ascending order.
Array.Sort(entries);
foreach (var entry in entries) {
var path = Path.Combine(dir.FullName, entry);
if (Directory.Exists(path)) {
IndexDirectory(writer, uidIter, new DirectoryInfo(path), operation);
} else if (File.Exists(path)) {
IndexFile(writer, uidIter, new FileInfo(path), operation);
}
}
}
开发者ID:Nangal,项目名称:lucene.net,代码行数:17,代码来源:IndexHtml.cs
示例6: ParallelTermEnum
public ParallelTermEnum(ParallelReader enclosingInstance)
{
InitBlock(enclosingInstance);
try
{
field = ((System.String) Enclosing_Instance.fieldToReader.GetKey(0));
}
catch (ArgumentOutOfRangeException e)
{
// No fields, so keep field == null, termEnum == null
return;
}
if (field != null)
termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms();
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:15,代码来源:ParallelReader.cs
示例7: ParallelTermEnum
public ParallelTermEnum(ParallelReader enclosingInstance, Term term)
{
InitBlock(enclosingInstance);
field = term.Field();
termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms(term);
}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:6,代码来源:ParallelReader.cs
示例8: ParallelTermEnum
public ParallelTermEnum(ParallelReader enclosingInstance)
{
InitBlock(enclosingInstance);
IEnumerator<string> e = Enclosing_Instance.fieldToReader.Keys.GetEnumerator();
if (e.MoveNext())
{
field = e.Current;
if (field != null)
termEnum = Enclosing_Instance.fieldToReader[field].Terms();
}
}
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:11,代码来源:ParallelReader.cs
示例9: Seek
public virtual void Seek(TermEnum termEnum)
{
in_Renamed.Seek(termEnum);
}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:4,代码来源:FilterIndexReader.cs
示例10: TestTermEnum
public TestTermEnum(TermEnum termEnum):base(termEnum)
{
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:3,代码来源:TestFilterIndexReader.cs
示例11: Seek
public virtual void Seek(TermEnum termEnum)
{
Seek(termEnum.Term());
if (termEnum is MultiTermEnum)
{
tenum = (MultiTermEnum) termEnum;
if (topReader != tenum.topReader)
tenum = null;
}
}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:10,代码来源:DirectoryReader.cs
示例12: Seek
/// <summary> Not implemented.</summary>
/// <throws> UnsupportedOperationException </throws>
public virtual void Seek(TermEnum termEnum)
{
throw new System.NotSupportedException();
}
开发者ID:sinsay,项目名称:SSE,代码行数:6,代码来源:MultipleTermPositions.cs
示例13: Seek
public virtual void Seek(TermEnum termEnum)
{
Seek(termEnum.Term);
var multiTermEnum = termEnum as MultiTermEnum;
if (multiTermEnum != null)
{
tenum = multiTermEnum;
if (topReader != tenum.topReader)
tenum = null;
}
}
开发者ID:synhershko,项目名称:lucene.net,代码行数:11,代码来源:DirectoryReader.cs
示例14: Seek
public virtual void Seek(TermEnum termEnum)
{
Seek(termEnum.Term());
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:4,代码来源:ParallelReader.cs
示例15: ParallelTermEnum
public ParallelTermEnum(ParallelReader enclosingInstance)
{
InitBlock(enclosingInstance);
try
{
field = Enclosing_Instance.fieldToReader.Keys.First();
}
catch (ArgumentOutOfRangeException)
{
// No fields, so keep field == null, termEnum == null
return;
}
if (field != null)
termEnum = Enclosing_Instance.fieldToReader[field].Terms();
}
开发者ID:modulexcite,项目名称:Xamarin-Lucene.Net,代码行数:15,代码来源:ParallelReader.cs
示例16: IndexFile
private static void IndexFile(IndexWriter writer, TermEnum uidIter, FileInfo file, Operation operation)
{
if (file.FullName.EndsWith(".html") || file.FullName.EndsWith(".htm") || file.FullName.EndsWith(".txt"))
{
// We've found a file we should index.
if (operation == Operation.IncrementalReindex ||
operation == Operation.RemoveStale)
{
// We should only get here with an open uidIter.
Debug.Assert(uidIter != null, "Expected uidIter != null for operation " + operation);
var uid = HTMLDocument.Uid(file); // construct uid for doc
while (uidIter.Term != null && uidIter.Term.Field == "uid" && String.CompareOrdinal(uidIter.Term.Text, uid) < 0)
{
if (operation == Operation.RemoveStale)
{
Console.Out.WriteLine("deleting " + HTMLDocument.Uid2url(uidIter.Term.Text));
writer.DeleteDocuments(uidIter.Term);
}
uidIter.Next();
}
// The uidIter TermEnum should now be pointing at either
// 1) a null term, meaning there are no more uids to check.
// 2) a term matching the current file.
// 3) a term not matching us.
if (uidIter.Term != null && uidIter.Term.Field == "uid" && String.CompareOrdinal(uidIter.Term.Text, uid) == 0)
{
// uidIter points to the current document, we should move one
// step ahead to keep state consistant, and carry on.
uidIter.Next();
}
else if (operation == Operation.IncrementalReindex)
{
// uidIter does not point to the current document, and we're
// currently indexing documents.
var doc = HTMLDocument.Document(file);
Console.Out.WriteLine("adding " + doc.Get("path"));
writer.AddDocument(doc);
}
}
else
{
// We're doing a complete reindexing. We aren't using uidIter,
// but for completeness we assert that it's null (as expected).
Debug.Assert(uidIter == null, "Expected uidIter == null for operation == " + operation);
var doc = HTMLDocument.Document(file);
Console.Out.WriteLine("adding " + doc.Get("path"));
writer.AddDocument(doc);
}
}
}
开发者ID:Nangal,项目名称:lucene.net,代码行数:55,代码来源:IndexHtml.cs
示例17: Seek
public void Seek(TermEnum termEnum)
{
throw new NotSupportedException();
}
开发者ID:sinsay,项目名称:SSE,代码行数:4,代码来源:AbstractAllTermDocs.cs
示例18: Seek
public SeekStatus Seek(String value)
{
termEnum = reader.Terms(new Term(this.fieldName, value));
Term t = Term();
if (t == null)
return SeekStatus.END;
return (t.Text.Equals(value)) ? SeekStatus.FOUND : SeekStatus.NOT_FOUND;
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:8,代码来源:TermsEnumCompatibility.cs
示例19: 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
示例20: Next
public override bool Next()
{
if (field == null)
return false;
bool next = termEnum.Next();
// still within field?
if (next && (System.Object) termEnum.Term().Field() == (System.Object) field)
return true; // yes, keep going
termEnum.Close(); // close old termEnum
// find the next field, if any
field = ((System.String) SupportClass.TailMap(Enclosing_Instance.fieldToReader, field).GetKey(0));
if (field != null)
{
termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms();
return true;
}
return false; // no more fields
}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:23,代码来源:ParallelReader.cs
注:本文中的Lucene.Net.Index.TermEnum类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论