Expert: constructs an IndexWriter with a custom {@link IndexDeletionPolicy}, for the index in
CopyC#
d
. Text will be analyzed with
CopyC#
a
. If
CopyC#
create
is true, then a new, empty index will be created in
CopyC#
d
, replacing the index already there, if any.

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,
	bool create,
	IndexDeletionPolicy deletionPolicy,
	IndexWriter..::..MaxFieldLength mfl
)
Visual Basic
Public Sub New ( _
	d As Directory, _
	a As Analyzer, _
	create As Boolean, _
	deletionPolicy As IndexDeletionPolicy, _
	mfl As IndexWriter..::..MaxFieldLength _
)
Visual C++
public:
IndexWriter(
	Directory^ d, 
	Analyzer^ a, 
	bool create, 
	IndexDeletionPolicy^ deletionPolicy, 
	IndexWriter..::..MaxFieldLength^ mfl
)

Parameters

d
Type: Lucene.Net.Store..::..Directory
the index directory
a
Type: Lucene.Net.Analysis..::..Analyzer
the analyzer to use
create
Type: System..::..Boolean
CopyC#
true
to create the index or overwrite the existing one;
CopyC#
false
to append to the existing index
deletionPolicy
Type: Lucene.Net.Index..::..IndexDeletionPolicy
see above
mfl
Type: Lucene.Net.Index..::..IndexWriter..::..MaxFieldLength
{@link Lucene.Net.Index.IndexWriter.MaxFieldLength}, whether or not to limit field lengths. Value is in number of terms/tokens

See Also