Closes the index with or without waiting for currently running merges to finish. This is only meaningful when using a MergeScheduler that runs merges in background threads.

NOTE: if this method hits an OutOfMemoryError you should immediately close the writer, again. See above for details.

NOTE: it is dangerous to always call close(false), especially when IndexWriter is not open for very long, because this can result in "merge starvation" whereby long merges will never have a chance to finish. This will cause too many segments in your index over time.

Namespace: Lucene.Net.Index
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public virtual void Close(
	bool waitForMerges
)
Visual Basic
Public Overridable Sub Close ( _
	waitForMerges As Boolean _
)
Visual C++
public:
virtual void Close(
	bool waitForMerges
)

Parameters

waitForMerges
Type: System..::..Boolean
if true, this call will block until all merges complete; else, it will ask all running merges to abort, wait until those merges have finished (which should be at most a few seconds), and then return.

See Also