Optimize the index down to <= maxNumSegments. If maxNumSegments==1 then this is the same as {@link #Optimize()}.

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

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

Syntax

C#
public virtual void Optimize(
	int maxNumSegments
)
Visual Basic
Public Overridable Sub Optimize ( _
	maxNumSegments As Integer _
)
Visual C++
public:
virtual void Optimize(
	int maxNumSegments
)

Parameters

maxNumSegments
Type: System..::..Int32
maximum number of segments left in the index after optimization finishes

See Also