This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/csharp/settings/format/search-settings.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. SearchSettings

Settings for Search. Values fall back through three levels: document → SDK → built-in default. Writes target the document only when set on a document’s settings, otherwise the SDK globally when set on SdkSettings.

using Nutrient;

The SDK creates this class through factory methods or other SDK objects.

Properties

Algorithm

public string Algorithm { get; set; }

Ranking algorithm id; empty selects the default. Ignored for an index input.

Type: string

ContextLines

public int ContextLines { get; set; }

Context lines around each hit.

Type: int

Display

public SearchDisplay Display { get; set; }

How the result is rendered to text.

Type: SearchDisplay

EmitIndexPath

public string EmitIndexPath { get; set; }

Path to also write a reusable index to; empty disables.

Type: string

Mode

public SearchMode Mode { get; set; }

How aggressively weak matches are filtered.

Type: SearchMode

StemmingLanguage

public string StemmingLanguage { get; set; }

ISO 639-1 language whose stemmer to apply (e.g. "en"), so morphological variants of a word match. "auto" detects the document language (via CLD3, when available). Empty or unsupported means no stemming.

Type: string

TopK

public int TopK { get; set; }

Maximum number of windows to return.

Type: int

Resource management

public void Dispose()

SearchSettings implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.