The example demonstrates a typical usage of the class.
stringindexFolder=@"c:\MyIndex\";stringdocumentFolder=@"c:\MyDocuments\";// Creating an indexIndexindex=newIndex(indexFolder);// Indexing documents from the specified folderindex.Add(documentFolder);// Setting search optionsSearchOptionsoptions=newSearchOptions();options.FuzzySearch.Enabled=true;// Enabling the fuzzy searchoptions.FuzzySearch.FuzzyAlgorithm=newTableDiscreteFunction(3);// Setting the maximum number of differences to 3// Search for documents containing the word 'Einstein' or the phrase 'Theory of Relativity'SearchResultresult=index.Search("Einstein OR \"Theory of Relativity\"",options);// Printing the resultConsole.WriteLine("Documents: "+result.DocumentCount);Console.WriteLine("Total occurrences: "+result.OccurrenceCount);for(inti=0;i<result.DocumentCount;i++){FoundDocumentdocument=result.GetFoundDocument(i);Console.WriteLine("\tDocument: "+document.DocumentInfo.FilePath);Console.WriteLine("\tOccurrences: "+document.OccurrenceCount);for(intj=0;j<document.FoundFields.Length;j++){FoundDocumentFieldfield=document.FoundFields[j];Console.WriteLine("\t\tField: "+field.FieldName);Console.WriteLine("\t\tOccurrences: "+document.OccurrenceCount);// Printing found termsif(field.Terms!=null){for(intk=0;k<field.Terms.Length;k++){Console.WriteLine("\t\t\t"+field.Terms[k].PadRight(20)+field.TermsOccurrences[k]);}}// Printing found phrasesif(field.TermSequences!=null){for(intk=0;k<field.TermSequences.Length;k++){stringsequence=string.Join(" ",field.TermSequences[k]);Console.WriteLine("\t\t\t"+sequence.PadRight(30)+field.TermSequencesOccurrences[k]);}}}}