Constructs an IndexWriter for the index in
CopyC#
path
. Text will be analyzed with
CopyC#
a
. If
CopyC#
create
is true, then a new, empty index will be created in
CopyC#
path
, 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#
[ObsoleteAttribute("Use IndexWriter(Directory, Analyzer,boolean, MaxFieldLength)")]
public IndexWriter(
	string path,
	Analyzer a,
	bool create,
	IndexWriter..::..MaxFieldLength mfl
)
Visual Basic
<ObsoleteAttribute("Use IndexWriter(Directory, Analyzer,boolean, MaxFieldLength)")> _
Public Sub New ( _
	path As String, _
	a As Analyzer, _
	create As Boolean, _
	mfl As IndexWriter..::..MaxFieldLength _
)
Visual C++
[ObsoleteAttribute(L"Use IndexWriter(Directory, Analyzer,boolean, MaxFieldLength)")]
public:
IndexWriter(
	String^ path, 
	Analyzer^ a, 
	bool create, 
	IndexWriter..::..MaxFieldLength^ mfl
)

Parameters

path
Type: System..::..String
the path to 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
mfl
Type: Lucene.Net.Index..::..IndexWriter..::..MaxFieldLength
Maximum field length in number of tokens/terms: LIMITED, UNLIMITED, or user-specified via the MaxFieldLength constructor.

See Also