Table of Contents

Enum SearchMode

Namespace
LMKit.Document.Search
Assembly
LM-Kit.NET.dll

Specifies the type of text search to perform.

public enum SearchMode

Fields

Text = 0

Exact substring matching.

Regex = 1

Regular expression matching.

Fuzzy = 2

Approximate 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.");

Share