This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/python/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.

Tags: Format

from nutrient_sdk import SearchSettings

Construction

SearchSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.

# Per-document override
with Document.open("input.pdf") as doc:
settings = doc.settings.search_settings
settings.some_field = new_value # mutate fields directly
# SDK-wide default (applies to all documents)
SdkSettings.search_settings.some_field = new_value

Settings are configured by writing to fields on the returned object. The settings property itself cannot be reassigned — doc.settings.search_settings = other_settings is rejected.

Properties

algorithm

@property
def algorithm(self) -> str
@algorithm.setter
def algorithm(self, value: str) -> None

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

Type: str

Default: string.Empty


context_lines

@property
def context_lines(self) -> int
@context_lines.setter
def context_lines(self, value: int) -> None

Context lines around each hit.

Type: int

Default: 5


display

@property
def display(self) -> SearchDisplay
@display.setter
def display(self, value: SearchDisplay) -> None

How the result is rendered to text.

Type: SearchDisplay

Default: SearchDisplay.Windows


emit_index_path

@property
def emit_index_path(self) -> str
@emit_index_path.setter
def emit_index_path(self, value: str) -> None

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

Type: str

Default: string.Empty


mode

@property
def mode(self) -> SearchMode
@mode.setter
def mode(self, value: SearchMode) -> None

How aggressively weak matches are filtered.

Type: SearchMode

Default: SearchMode.Balanced


stemming_language

@property
def stemming_language(self) -> str
@stemming_language.setter
def stemming_language(self, value: str) -> None

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: str

Default: string.Empty


top_k

@property
def top_k(self) -> int
@top_k.setter
def top_k(self, value: int) -> None

Maximum number of windows to return.

Type: int

Default: 8