本文整理汇总了C#中Lucene.Net.Index.IndexWriter.SetWriteLockTimeout方法的典型用法代码示例。如果您正苦于以下问题:C# IndexWriter.SetWriteLockTimeout方法的具体用法?C# IndexWriter.SetWriteLockTimeout怎么用?C# IndexWriter.SetWriteLockTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.IndexWriter
的用法示例。
在下文中一共展示了IndexWriter.SetWriteLockTimeout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateWriterNoTry
private IndexWriter CreateWriterNoTry(Directory d, Analyzer a)
{
var indexExists = IndexExists();
logger.Debug("Creating index writer, index exists: " + indexExists);
var iw = new IndexWriter(d, a, create: !indexExists, mfl: IndexWriter.MaxFieldLength.UNLIMITED);
iw.SetWriteLockTimeout(LockTimeout);
return iw;
}
示例2: CreateWriter
protected virtual IndexWriter CreateWriter(Directory d, Analyzer a)
{
var iw = new IndexWriter(d, a, create: !IndexExists(), mfl: IndexWriter.MaxFieldLength.UNLIMITED);
iw.SetWriteLockTimeout(LockTimeout);
return iw;
}
示例3: GetIndexWriter
public virtual IndexWriter GetIndexWriter( string indexName )
{
IndexWriter writer;
if ( !indexWriters.TryGetValue( indexName, out writer ) )
{
var index = GetIndex( indexName );
var analyzer = GetIndexingAnalyzer( indexName );
writer = new IndexWriter( index, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED );
writer.SetRAMBufferSizeMB( configuration.MemoryBufferLimit );
writer.SetWriteLockTimeout( configuration.WriterLockTimeout );
writer.MaybeMerge();
indexWriters.TryAdd( indexName, writer );
}
return writer;
}