Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Classes | Namespaces | Typedefs
IndexWriter.cs File Reference

Go to the source code of this file.

Classes

class  Lucene.Net.Index.IndexWriter
 An IndexWriter creates and maintains an index. The create argument to the constructor determines whether a new index is created, or whether an existing index is opened. Note that you can open an index with create=true even while readers are using the index. The old readers will continue to search the "point in time" snapshot they had opened, and won't see the newly created index until they re-open. There are also constructors with no create argument which will create a new index if there is not already an index at the provided path and otherwise open the existing index.In either case, documents are added with AddDocument(Document) and removed with DeleteDocuments(Term) or DeleteDocuments(Query). A document can be updated with UpdateDocument(Term, Document) (which just deletes and then adds the entire document). When finished adding, deleting and updating documents, Close() should be called. These changes are buffered in memory and periodically flushed to the Directory (during the above method calls). A flush is triggered when there are enough buffered deletes (see SetMaxBufferedDeleteTerms) or enough added documents since the last flush, whichever is sooner. For the added documents, flushing is triggered either by RAM usage of the documents (see SetRAMBufferSizeMB) or the number of added documents. The default is to flush when RAM usage hits 16 MB. For best indexing speed you should flush by RAM usage with a large RAM buffer. Note that flushing just moves the internal buffered state in IndexWriter into the index, but these changes are not visible to IndexReader until either Commit() or Close() is called. A flush may also trigger one or more segment merges which by default run with a background thread so as not to block the addDocument calls (see below for changing the MergeScheduler). If an index will not have more documents added for a while and optimal search performance is desired, then either the full Optimize() method or partial Optimize(int) method should be called before the index is closed. Opening an IndexWriter creates a lock file for the directory in use. Trying to open another IndexWriter on the same directory will lead to a LockObtainFailedException. The LockObtainFailedException is also thrown if an IndexReader on the same directory is used to delete documents from the index. More...
 
class  Lucene.Net.Index.IndexWriter.ReaderPool
 Holds shared SegmentReader instances. IndexWriter uses SegmentReaders for 1) applying deletes, 2) doing merges, 3) handing out a real-time reader. This pool reuses instances of the SegmentReaders in all these places if it is in "near real-time mode" (getReader() has been called on this instance).
 
class  Lucene.Net.Index.IndexWriter.MaxFieldLength
 Specifies maximum field length (in number of tokens/terms) in IndexWriter constructors. SetMaxFieldLength(int) overrides the value set by the constructor. More...
 
class  Lucene.Net.Index.IndexWriter.IndexReaderWarmer
 If GetReader() has been called (ie, this writer is in near real-time mode), then after a merge completes, this class can be invoked to warm the reader on the newly merged segment, before the merge commits. This is not required for near real-time search, but will reduce search latency on opening a new near real-time reader after a merge completes. More...
 

Namespaces

package  Lucene.Net.Index
 

Typedefs

using Analyzer = Lucene.Net.Analysis.Analyzer
 
using Document = Lucene.Net.Documents.Document
 
using IndexingChain = Lucene.Net.Index.DocumentsWriter.IndexingChain
 
using AlreadyClosedException = Lucene.Net.Store.AlreadyClosedException
 
using BufferedIndexInput = Lucene.Net.Store.BufferedIndexInput
 
using Directory = Lucene.Net.Store.Directory
 
using Lock = Lucene.Net.Store.Lock
 
using LockObtainFailedException = Lucene.Net.Store.LockObtainFailedException
 
using Constants = Lucene.Net.Util.Constants
 
using Query = Lucene.Net.Search.Query
 
using Similarity = Lucene.Net.Search.Similarity
 

Typedef Documentation

Definition at line 25 of file IndexWriter.cs.

Definition at line 22 of file IndexWriter.cs.

Definition at line 26 of file IndexWriter.cs.

Definition at line 30 of file IndexWriter.cs.

Definition at line 27 of file IndexWriter.cs.

Definition at line 23 of file IndexWriter.cs.

using IndexingChain = Lucene.Net.Index.DocumentsWriter.IndexingChain

Definition at line 24 of file IndexWriter.cs.

Definition at line 28 of file IndexWriter.cs.

Definition at line 29 of file IndexWriter.cs.

Definition at line 31 of file IndexWriter.cs.

Definition at line 32 of file IndexWriter.cs.