---
layout: docs
page_title: search Block in Agent Configuration
sidebar_title: search
description: >-
  Configure the Nomad server search API in the `search` block of a Nomad agent configuration. Enable fuzzy searching. Configure the minimum size of the search term, the maximum number of Nomad objects to search through per context type, and the max number of matching results.
---

# `search` Block in Agent Configuration

<Placement
  groups={[
    ['server', 'search'],
  ]}
/>

This page provides reference information for configuring the Nomad server search
API in the `search` block of a Nomad agent configuration. Enable fuzzy
searching. Configure the minimum size of the search term, the maximum number of
Nomad objects to search through per context type, and the max number of matching results.

```hcl
server {
  search {
    fuzzy_enabled   = true
    limit_query     = 200
    limit_results   = 1000
    min_term_length = 5
  }
}
```

## `search` Parameters

- `fuzzy_enabled` `(bool: true)` - Specifies whether the [fuzzy search API][fuzzy]
  is enabled. If not enabled, requests to the fuzzy search API endpoint will return
  an error response.

- `limit_query` `(int: 20)` - Specifies the maximum number of Nomad objects to
  search through per context type in the Nomad server before truncating results.
  Setting this parameter to a high value may degrade Nomad server performance.

- `limit_results` `(int: 100)` - Specifies the maximum number of matching results
  to accumulate per context type in the API response before truncating results.
  Setting this parameter to a high value may cause excessively large API response sizes.

- `min_term_length` `(int: 2)` - Specifies the minimum size of the search term
  allowed for matching with the fuzzy search API. Setting this value higher can
  prevent unnecessary load on the Nomad server from broad queries.

[fuzzy]: /nomad/api-docs/search#fuzzy-searching
