Lucene.Net.Index.IndexWriter.NewSegmentName C# (CSharp) Method

NewSegmentName() private method

private NewSegmentName ( ) : System.String
return System.String
		internal System.String NewSegmentName()
		{
			// Cannot synchronize on IndexWriter because that causes
			// deadlock
			lock (segmentInfos)
			{
				// Important to increment changeCount so that the
				// segmentInfos is written on close.  Otherwise we
				// could close, re-open and re-return the same segment
				// name that was previously returned which can cause
				// problems at least with ConcurrentMergeScheduler.
				changeCount++;
				return "_" + Number.ToString(segmentInfos.counter++);
			}
		}
		

Usage Example

Beispiel #1
0
 private void EnsureInitialized(ThreadState state)
 {
     if (state.IsActive && state.dwpt == null)
     {
         FieldInfos.Builder infos = new FieldInfos.Builder(writer.globalFieldNumberMap);
         state.dwpt = new DocumentsWriterPerThread(writer.NewSegmentName(), directory, config, infoStream, deleteQueue, infos);
     }
 }
All Usage Examples Of Lucene.Net.Index.IndexWriter::NewSegmentName
IndexWriter