Apache Lucene.Net 2.4.0 Class Library API

IndexModifier Members

IndexModifier overview

Public Instance Constructors

IndexModifier Overloaded. Initializes a new instance of the IndexModifier class.

Public Instance Methods

AddDocumentOverloaded. 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.
Close Close this index, writing all pending changes to disk.
DeleteDocument Deletes the document numbered
docNum
.
DeleteDocuments Deletes all documents containing
term
. This is useful if one uses a document field to hold a unique ID string for the document. Then to delete such a document, one merely constructs a term with the appropriate field and the unique ID string as its text and passes it to this method. Returns the number of documents deleted.
DocCount Returns the number of documents currently in this index. If the writer is currently open, this returns IndexWriter.DocCount(), else IndexReader.NumDocs(). But, note that IndexWriter.DocCount() does not take deltions into account, unlike IndexReader.NumDocs().
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
Flush Make sure all changes are written to disk.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetInfoStream has this index open (
write.lock
could not be obtained)
GetMaxBufferedDocs has this index open (
write.lock
could not be obtained)
GetMaxFieldLength has this index open (
write.lock
could not be obtained)
GetMergeFactor has this index open (
write.lock
could not be obtained)
GetType (inherited from Object)Gets the Type of the current instance.
GetUseCompoundFile has this index open (
write.lock
could not be obtained)
Optimize Merges all segments together into a single segment, optimizing an index for search.
SetInfoStream 
SetMaxBufferedDocs 
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 accomodate 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 
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 

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

Protected Internal Instance Fields

analyzer 
directory 
indexReader 
indexWriter 
infoStream 
maxBufferedDocs 
maxFieldLength 
mergeFactor 
open 
useCompoundFile 

Protected Internal Instance Methods

AssureOpen Throw an IllegalStateException if the index is closed.
CreateIndexReader Close the IndexWriter and open an IndexReader.
CreateIndexWriter Close the IndexReader and open an IndexWriter.
Init Initialize an IndexWriter.

See Also

IndexModifier Class | Lucene.Net.Index Namespace