SimilarityLevel Class |
Namespace: GroupDocs.Search.Options
The SimilarityLevel type exposes the following members.
Name | Description | |
---|---|---|
![]() | SimilarityLevel |
Initializes a new instance of the SimilarityLevel class.
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetMaxMistakeCount |
Gets the maximum allowed number of mistakes for the specified term length.
(Overrides FuzzyAlgorithmGetMaxMistakeCount(Int32).) |
![]() | GetSimilarityLevel |
Gets the similarity level value for the specified term length.
(Overrides FuzzyAlgorithmGetSimilarityLevel(Int32).) |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
string indexFolder = @"c:\MyIndex\"; string documentsFolder = @"c:\MyDocuments\"; string query = "Einstein"; Index index = new Index(indexFolder); // Creating an 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 SimilarityLevel(0.8); // Creating the fuzzy search algorithm // This function specifies 0 as the maximum number of mistakes for words from 1 to 4 characters. // It specifies 1 as the maximum number of mistakes for words from 5 to 9 characters. // It specifies 2 as the maximum number of mistakes for words from 10 to 14 characters. And so on. SearchResult result = index.Search(query, options); // Search in index