Expert: constructs an IndexWriter on specific commit point, with a custom {@link IndexDeletionPolicy}, for the index in
CopyC#
d
. Text will be analyzed with
CopyC#
a
.

This is only meaningful if you've used a {@link IndexDeletionPolicy} in that past that keeps more than just the last commit.

This operation is similar to {@link #Rollback()}, except that method can only rollback what's been done with the current instance of IndexWriter since its last commit, whereas this method can rollback to an arbitrary commit point from the past, assuming the {@link IndexDeletionPolicy} has preserved past commits.

NOTE: autoCommit (see above) is set to false with this constructor.

has this index open (
CopyC#
write.lock
could not be obtained)
if it does not exist and
CopyC#
create
is
CopyC#
false
or if there is any other low-level IO error

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

Syntax

C#
public IndexWriter(
	Directory d,
	Analyzer a,
	IndexDeletionPolicy deletionPolicy,
	IndexWriter..::..MaxFieldLength mfl,
	IndexCommit commit
)
Visual Basic
Public Sub New ( _
	d As Directory, _
	a As Analyzer, _
	deletionPolicy As IndexDeletionPolicy, _
	mfl As IndexWriter..::..MaxFieldLength, _
	commit As IndexCommit _
)
Visual C++
public:
IndexWriter(
	Directory^ d, 
	Analyzer^ a, 
	IndexDeletionPolicy^ deletionPolicy, 
	IndexWriter..::..MaxFieldLength^ mfl, 
	IndexCommit^ commit
)

Parameters

d
Type: Lucene.Net.Store..::..Directory
the index directory
a
Type: Lucene.Net.Analysis..::..Analyzer
the analyzer to use
deletionPolicy
Type: Lucene.Net.Index..::..IndexDeletionPolicy
see above
mfl
Type: Lucene.Net.Index..::..IndexWriter..::..MaxFieldLength
whether or not to limit field lengths, value is in number of terms/tokens. See {@link Lucene.Net.Index.IndexWriter.MaxFieldLength}.
commit
Type: Lucene.Net.Index..::..IndexCommit
which commit to open

See Also