Initializes a new instance of the Index class. Loads an existing index from disk if overwriteIfExists is false; creates a new index on disk with particular index settings otherwise.
Deletes indexed files or folders from the index. The deleted documents are excluded from search immediately and are physically removed from the index when the index is optimized with Optimize. Note that an individual document cannot be deleted from the index if it was added to the index as part of a folder.
Deletes documents indexed from streams or structures. The deleted documents are excluded from search immediately and are physically removed from the index when the index is optimized with Optimize.
Minimizes the number of index segments by merging them one with another. This operation improves search performance and physically removes deleted documents from the index. A very large index is optimized into several segments of limited size.
Minimizes the number of index segments by merging them one with another. This operation improves search performance and physically removes deleted documents from the index. A very large index is optimized into several segments of limited size.
Re-indexes documents that have been changed or deleted since the last update. Adds new files that have been added to the indexed folders.
Remarks
A folder is used by one Index object at a time, in this process or in another one: a constructor that creates or opens an index in a folder that another Index object uses throws IOException. The folder is released when the index is disposed, or when the garbage collector finalizes an index that is not disposed. An index loaded into memory by LoadIntoMemoryCompletely does not use its folder.
The example demonstrates a typical usage of the class.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";stringquery="Einstein";Indexindex=newIndex(indexFolder);// Creating index in the specified folderindex.Add(documentsFolder);// Indexing documents from the specified folderSearchResultresult=index.Search(query);// Searching in index