The IndexModifier type exposes the following members.
Constructors
Name | Description | |
---|---|---|
IndexModifier(FileInfo, Analyzer, Boolean) | Open an index with write access.
| |
IndexModifier(String, Analyzer, Boolean) | Open an index with write access.
| |
IndexModifier(Directory, Analyzer, Boolean) | Open an index with write access.
|
Methods
Name | Description | |
---|---|---|
AddDocument(Document) | Adds a document to this index. If the document contains more than
{@link #SetMaxFieldLength(int)} terms for a given field, the remainder are
discarded.
| |
AddDocument(Document, Analyzer) | Adds a document to this index, using the provided analyzer instead of the
one specific in the constructor. If the document contains more than
{@link #SetMaxFieldLength(int)} terms for a given field, the remainder are
discarded.
| |
AssureOpen | Throw an IllegalStateException if the index is closed. | |
Close | Close this index, writing all pending changes to disk.
| |
CreateIndexReader | Close the IndexWriter and open an IndexReader. | |
CreateIndexWriter | Close the IndexReader and open an IndexWriter. | |
DeleteDocument | Deletes the document numbered CopyC# docNum | |
DeleteDocuments | Deletes all documents containing CopyC# term | |
DocCount | Returns the number of documents currently in this
index. If the writer is currently open, this returns
{@link IndexWriter#DocCount()}, else {@link
IndexReader#NumDocs()}. But, note that {@link
IndexWriter#DocCount()} does not take deletions into
account, unlike {@link IndexReader#numDocs}.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
Flush | Make sure all changes are written to disk. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetInfoStream | has this index open ( CopyC# write.lock | |
GetMaxBufferedDocs | has this index open ( CopyC# write.lock | |
GetMaxFieldLength | has this index open ( CopyC# write.lock | |
GetMergeFactor | has this index open ( CopyC# write.lock | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUseCompoundFile | has this index open ( CopyC# write.lock | |
Init | Initialize an IndexWriter. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Optimize | Merges all segments together into a single segment, optimizing an index
for search.
| |
SetInfoStream | If non-null, information about merges and a message when
{@link #GetMaxFieldLength()} is reached will be printed to this.
Example: index.setInfoStream(System.err); | |
SetMaxBufferedDocs | Determines the minimal number of documents required before the buffered
in-memory documents are merging and a new Segment is created.
Since Documents are merged in a {@link Lucene.Net.Store.RAMDirectory},
large value gives faster indexing. At the same time, mergeFactor limits
the number of files open in a FSDirectory.
The default value is 10.
| |
SetMaxFieldLength | The maximum number of terms that will be indexed for a single field in a
document. This limits the amount of memory required for indexing, so that
collections with very large files will not crash the indexing process by
running out of memory.
Note that this effectively truncates large documents, excluding from the
index terms that occur further in the document. If you know your source
documents are large, be sure to set this value high enough to accommodate
the expected size. If you set it to Integer.MAX_VALUE, then the only limit
is your memory, but you should anticipate an OutOfMemoryError.
By default, no more than 10,000 terms will be indexed for a field.
| |
SetMergeFactor | Determines how often segment indices are merged by addDocument(). With
smaller values, less RAM is used while indexing, and searches on
unoptimized indices are faster, but indexing speed is slower. With larger
values, more RAM is used during indexing, and while searches on unoptimized
indices are slower, indexing is faster. Thus larger values (> 10) are best
for batch index creation, and smaller values (< 10) for indices that are
interactively maintained.
This must never be less than 2. The default value is 10.
| |
SetUseCompoundFile | Setting to turn on usage of a compound file. When on, multiple files
for each segment are merged into a single file once the segment creation
is finished. This is done regardless of what directory is in use.
| |
ToString | (Overrides Object..::..ToString()()()().) |
Fields
Name | Description | |
---|---|---|
analyzer | ||
closeDir | ||
directory | ||
indexReader | ||
indexWriter | ||
infoStream | ||
maxBufferedDocs | ||
maxFieldLength | ||
mergeFactor | ||
open | ||
useCompoundFile |