Apache Lucene.Net 2.4.0 Class Library API

IndexWriter Constructor (String, Analyzer, Boolean)

NOTE: This constructor is now obsolete.

This constructor will be removed in the 3.0 release. Use IndexWriter(string, Analyzer, bool, MaxFieldLength) instead, and call Commit() when needed


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
path
, replacing the index already there, if any.

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(
   string path,
   Analyzer a,
   bool create
);

Parameters

path
the path to 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

See Also

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