Deletes indexed files or folders from the index. Then updates the index without deleted paths. Note that an individual document cannot be deleted from the index if it was added to the index as part of a folder.
An object describing the result of deleting files or folders from the index.
Examples
The example demonstrates how to delete indexed paths from an index.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder1=@"c:\MyDocuments\";stringdocumentsFolder2=@"c:\MyDocuments2\";// Creating an index in the specified folderIndexindex=newIndex(indexFolder);// Indexing documents from the specified foldersindex.Add(documentsFolder1);index.Add(documentsFolder2);// Getting indexed paths from the indexstring[]indexedPaths1=index.GetIndexedPaths();// Writing indexed paths to the consoleConsole.WriteLine("Indexed paths:");foreach(stringpathinindexedPaths1){Console.WriteLine("\t"+path);}// Deleting index path from the indexDeleteResultdeleteResult=index.Delete(newstring[]{documentsFolder1},newUpdateOptions());// Getting indexed paths after deletionstring[]indexedPaths2=index.GetIndexedPaths();Console.WriteLine("\nDeleted paths: "+deleteResult.SuccessCount);Console.WriteLine("\nIndexed paths:");foreach(stringpathinindexedPaths2){Console.WriteLine("\t"+path);}