IndexSearch Method (String, SearchOptions) |
Namespace: GroupDocs.Search
string indexFolder = @"c:\MyIndex\"; string documentsFolder = @"c:\MyDocuments\"; Index index = new Index(indexFolder); // Creating index in the specified folder index.Add(documentsFolder); // Indexing documents from the specified folder SearchOptions options = new SearchOptions(); options.FuzzySearch.Enabled = true; // Enabling the fuzzy search options.FuzzySearch.FuzzyAlgorithm = new TableDiscreteFunction(1); // Setting the number of possible differences for each word // Double quotes at the beginning and end tells the index that it is phrase search query string query = "\"The Pursuit of Happiness\""; SearchResult result = index.Search(query, options); // Searching
string indexFolder = @"c:\MyIndex\"; string documentsFolder = @"c:\MyDocuments\"; Index index = new Index(indexFolder); // Creating index in the specified folder index.Add(documentsFolder); // Indexing documents from the specified folder SearchOptions options = new SearchOptions(); options.UseSynonymSearch = true; // Enabling the synonym search string query = "cry"; SearchResult result = index.Search(query, options); // Searching