Gets or sets the fuzzy search algorithm. The currently available fuzzy search algorithms are SimilarityLevel and TableDiscreteFunction. The default value is an instance of SimilarityLevel with a similarity level value of 0.5.
publicFuzzyAlgorithmFuzzyAlgorithm{get;set;}
Property Value
The fuzzy search algorithm.
Exceptions
exception
condition
ArgumentNullException
Thrown when value is null.
Examples
The example demonstrates how to set the fuzzy search algorithm.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";stringquery="Einstein";Indexindex=newIndex(indexFolder);// Creating an index in the specified folderindex.Add(documentsFolder);// Indexing documents from the specified folderSearchOptionsoptions=newSearchOptions();options.FuzzySearch.Enabled=true;// Enabling the fuzzy searchoptions.FuzzySearch.FuzzyAlgorithm=newTableDiscreteFunction(1,newStep(5,2),newStep(8,3));// Creating the fuzzy search algorithm// This function specifies 1 as the maximum number of mistakes for words from 1 to 4 characters.// It specifies 2 as the maximum number of mistakes for words from 5 to 7 characters.// It specifies 3 as the maximum number of mistakes for words from 8 and more characters.SearchResultresult=index.Search(query,options);// Search in index