Constructor IndexWriter
IndexWriter(Directory, Analyzer, Boolean, IndexWriter.MaxFieldLength)
Constructs an IndexWriter for the index in d
.
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.
Declaration
public IndexWriter(Directory d, Analyzer a, bool create, IndexWriter.MaxFieldLength mfl)
Parameters
Type | Name | Description |
---|---|---|
Directory | d | the index directory |
Analyzer | a | the analyzer to use |
System.Boolean | create |
|
IndexWriter.MaxFieldLength | mfl | Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified via the MaxFieldLength constructor. |
IndexWriter(Directory, Analyzer, IndexWriter.MaxFieldLength)
Constructs an IndexWriter for the index in
d
, first creating it if it does not
already exist.
Declaration
public IndexWriter(Directory d, Analyzer a, IndexWriter.MaxFieldLength mfl)
Parameters
Type | Name | Description |
---|---|---|
Directory | d | the index directory |
Analyzer | a | the analyzer to use |
IndexWriter.MaxFieldLength | mfl | Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified via the MaxFieldLength constructor. |
IndexWriter(Directory, Analyzer, IndexDeletionPolicy, IndexWriter.MaxFieldLength)
Expert: constructs an IndexWriter with a custom IndexDeletionPolicy
, for the index in d
,
first creating it if it does not already exist. Text
will be analyzed with a
.
Declaration
public IndexWriter(Directory d, Analyzer a, IndexDeletionPolicy deletionPolicy, IndexWriter.MaxFieldLength mfl)
Parameters
Type | Name | Description |
---|---|---|
Directory | d | the index directory |
Analyzer | a | the analyzer to use |
IndexDeletionPolicy | deletionPolicy | see above |
IndexWriter.MaxFieldLength | mfl | whether or not to limit field lengths |
IndexWriter(Directory, Analyzer, Boolean, IndexDeletionPolicy, IndexWriter.MaxFieldLength)
Expert: constructs an IndexWriter with a custom IndexDeletionPolicy
, for the index in d
.
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.
Declaration
public IndexWriter(Directory d, Analyzer a, bool create, IndexDeletionPolicy deletionPolicy, IndexWriter.MaxFieldLength mfl)
Parameters
Type | Name | Description |
---|---|---|
Directory | d | the index directory |
Analyzer | a | the analyzer to use |
System.Boolean | create |
|
IndexDeletionPolicy | deletionPolicy | see above |
IndexWriter.MaxFieldLength | mfl | IndexWriter.MaxFieldLength, whether or not to limit field lengths. Value is in number of terms/tokens |
IndexWriter(Directory, Analyzer, IndexDeletionPolicy, IndexWriter.MaxFieldLength, IndexCommit)
Expert: constructs an IndexWriter on specific commit
point, with a custom IndexDeletionPolicy, for
the index in d
. Text will be analyzed
with a
.
This is only meaningful if you've used a IndexDeletionPolicy in that past that keeps more than just the last commit.
This operation is similar to 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 IndexDeletionPolicy has preserved past commits.
Declaration
public IndexWriter(Directory d, Analyzer a, IndexDeletionPolicy deletionPolicy, IndexWriter.MaxFieldLength mfl, IndexCommit commit)
Parameters
Type | Name | Description |
---|---|---|
Directory | d | the index directory |
Analyzer | a | the analyzer to use |
IndexDeletionPolicy | deletionPolicy | see above |
IndexWriter.MaxFieldLength | mfl | whether or not to limit field lengths, value is in number of terms/tokens. See IndexWriter.MaxFieldLength. |
IndexCommit | commit | which commit to open |