GroupDocsGists
10/19/2017 - 11:15 AM

ExactPhraseSearch.cs

// For complete examples and data files, please go to https://github.com/groupdocs-search/GroupDocs.Search-for-.NET
// Create or load index
Index index = new Index(Utilities.indexPath,true);
            
index.AddToIndex(Utilities.documentsPath);

SearchResults searchResults = index.Search("\"exact search query\""); // search query for exact search should be in double quotes

// List of found files
foreach (DocumentResultInfo documentResultInfo in searchResults)
{
    Console.WriteLine("Query \"{0}\" has {1} hit count in file: {2}", searchString, documentResultInfo.HitCount, documentResultInfo.FileName);
}