Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created November 22, 2019 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/eaa4ea35ded2e19f062eb12d7499fcdb to your computer and use it in GitHub Desktop.
Save GroupDocsGists/eaa4ea35ded2e19f062eb12d7499fcdb to your computer and use it in GitHub Desktop.
string indexFolder = @"D://Samples/Index";
string documentsFolder = @"D://Samples/Source/Index";
// Creating index in the specified folder
Index index = new Index(indexFolder);
// Indexing documents from the specified folder
index.Add(documentsFolder);
// Searching in index
SearchResult result = index.Search("video");
foreach (FoundDocument document in result)
{
Console.WriteLine("Document Path : " + document.DocumentInfo.FilePath);
Console.WriteLine("Occurance : " + document.OccurrenceCount + "\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment