Apache Lucene.Net 2.4.0 Class Library API

IndexWriter Constructor (Directory, Analyzer, Boolean, MaxFieldLength)

Constructs an IndexWriter for the index in
path
. Text will be analyzed with
a
. If
create
is true, then a new, empty index will be created in
d
, replacing the index already there, if any.

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

Throws CorruptIndexException if the index is corrupt

Throws LockObtainFailedException if another writer has this index open (

write.lock
could not be obtained)

Throws System.IO.IOException if the directory cannot be read/written to, or if it does not exist and

create
is
false
or if there is any other low-level IO error

public IndexWriter(
   Directory d,
   Analyzer a,
   bool create,
   MaxFieldLength mfl
);

Parameters

d
the index directory
a
the analyzer to use
create
true
to create the index or overwrite the existing one;
false
to append to the existing index
mfl
Maximum field Length: LIMITED, UNLIMITED, or user-specified

See Also

IndexWriter Class | Lucene.Net.Index Namespace | IndexWriter Constructor Overload List