Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
string indexFolder = @"c:\MyIndex\";
string documentsFolder1 = @"c:\MyDocuments\";
string documentsFolder2 = @"c:\MyDocuments2\";
// Creating an index in the specified folder
Index index = new Index(indexFolder);
// Indexing documents from the specified folders
index.Add(documentsFolder1);
index.Add(documentsFolder2);
// Getting indexed paths from the index
string[] indexedPaths1 = index.GetIndexedPaths();
// Writing indexed paths to the console
Console.WriteLine("Indexed paths:");
foreach (string path in indexedPaths1)
{
Console.WriteLine("\t" + path);
}
// Deleting index path from the index
DeleteResult deleteResult = index.Delete(new string[] { documentsFolder1 }, new UpdateOptions());
// Getting indexed paths after deletion
string[] indexedPaths2 = index.GetIndexedPaths();
Console.WriteLine("\nDeleted paths: " + deleteResult.SuccessCount);
Console.WriteLine("\nIndexed paths:");
foreach (string path in indexedPaths2)
{
Console.WriteLine("\t" + path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.