Enum SearchMode
Specifies the type of text search to perform.
public enum SearchMode
Fields
Text = 0Exact substring matching.
Regex = 1Regular expression matching.
Fuzzy = 2Approximate matching using Damerau-Levenshtein edit distance.
Examples
Example: Select a search mode based on user input.
using LMKit.Document.Search;
string userChoice = "fuzzy";
SearchMode mode = userChoice.ToLowerInvariant() switch
{
"text" => SearchMode.Text,
"regex" => SearchMode.Regex,
"fuzzy" => SearchMode.Fuzzy,
_ => SearchMode.Text
};
var options = new SearchHighlightOptions { SearchMode = mode };
SearchHighlightResult result = await SearchHighlightEngine.HighlightAsync(
"document.pdf", "search term", options);
Console.WriteLine($"Used {result.SearchMode} mode, found {result.TotalMatches} matches.");