---
title: "SearchSettings"
canonical_url: "https://www.nutrient.io/api/python/settings/format/search-settings/"
md_url: "https://www.nutrient.io/api/python/settings/format/search-settings.md"
last_updated: "2026-07-15T14:46:57.766Z"
description: "Settings for Search. Values fall back through three levels: document → SDK → built-in default."
---

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`

```python

from nutrient_sdk import SearchSettings

```

## Construction

`SearchSettings` is accessed through a [`Document`](/api/python/document/) instance for per-document overrides, or via [`SdkSettings`](/api/python/settings/document/sdk-settings/) for SDK-wide defaults.

```python

# 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

```python

@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

```python

@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

```python

@property
def display(self) -> SearchDisplay

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

```

How the result is rendered to text.

**Type:** [`SearchDisplay`](/api/python/enums/search-display/)

**Default:** `SearchDisplay.Windows`

---

### emit_index_path

```python

@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

```python

@property
def mode(self) -> SearchMode

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

```

How aggressively weak matches are filtered.

**Type:** [`SearchMode`](/api/python/enums/search-mode/)

**Default:** `SearchMode.Balanced`

---

### stemming_language

```python

@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

```python

@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`

---

---

## Related pages

- [Format](/api/python/settings/format.md)
- [Per-document override](/api/python/settings/format/cad-settings.md)
- [Per-document override](/api/python/settings/format/email-settings.md)
- [Per-document override](/api/python/settings/format/html-settings.md)
- [Per-document override](/api/python/settings/format/image-settings.md)
- [Per-document override](/api/python/settings/format/jpeg-settings.md)
- [Per-document override](/api/python/settings/format/markdown-settings.md)
- [Per-document override](/api/python/settings/format/pdf-settings.md)
- [Per-document override](/api/python/settings/format/spreadsheet-settings.md)
- [Per-document override](/api/python/settings/format/text-settings.md)
- [Per-document override](/api/python/settings/format/word-settings.md)

