本文整理汇总了C#中IndexWriter.getDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# IndexWriter.getDirectory方法的具体用法?C# IndexWriter.getDirectory怎么用?C# IndexWriter.getDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndexWriter
的用法示例。
在下文中一共展示了IndexWriter.getDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThumbnailIndexer
public ThumbnailIndexer(IndexPreferences indexPreferences)
{
this.indexPreferences = indexPreferences;
if (!System.IO.Directory.Exists(Preferences.Instance.ThumbIndexFolder))
{
logger.Info("Creating thumbs folder: '{0}'", Preferences.Instance.ThumbIndexFolder);
System.IO.Directory.CreateDirectory(Preferences.Instance.ThumbIndexFolder);
}
var config = new IndexWriterConfig(FindAPhotoAnalyzers.IndexVersion, FindAPhotoAnalyzers.ForIndexing());
writer = new IndexWriter(
FSDirectory.open(new java.io.File(Preferences.Instance.ThumbIndexFolder)),
config);
writer.commit();
searchManager = new SearchManager(writer.getDirectory());
tasks.Add(Task.Run(DequeueFiles));
tasks.Add(Task.Run(DequeueFiles));
tasks.Add(Task.Run(CommitTask));
}
示例2: VisitAllDocuments
private void VisitAllDocuments(IndexWriter writer, Action<IndexWriter,Document> action)
{
using (var searchManager = new SearchManager(writer.getDirectory()))
{
using (var search = searchManager.Wrapper())
{
var results = search.IndexSearcher.search(new MatchAllDocsQuery(), writer.maxDoc());
for (int idx = 0; idx < results.totalHits; ++idx)
{
if (shutdown)
{
break;
}
CheckForCommit(writer);
action(writer, search.IndexSearcher.doc(results.scoreDocs[idx].doc));
}
}
}
}