hashicorp / hashicorp/nomad

api: configuring fuzzy search min_term_length turns fuzzy search off

Open
#10,587 0 comments 0 reactions 0 assignees View on GitHub
theme/api type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version

```
Nomad v1.1.0-rc1 (c16a2850549eae74a0bfab5aad359b3c6926280f)
```

### Operating system and Environment details

macOS 10.14.6

```
~/Downloads/nomad-110-rc1 agent -dev -config=server-longer-minimum-search.hcl
```

### Issue

With the following server configuration:

```
server {
search {
min_search_length = 3
}
}
```

Running a fuzzy search query produces the 500 error:

```
curl 'http://localhost:4646/v1/search/fuzzy' --data-raw '{"Text":"xyz","Context":"all"}'

fuzzy search is not enabled
```

#### Expected Result

The [documentation](https://www.nomadproject.io/docs/configuration/search#fuzzy_enabled) says `fuzzy_enabled` defaults to `true` (and that matches with my experience when I don’t specify a server configuration) but setting `min_search_length` appears to override that to `false`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the /v1/search/fuzzy endpoint and the server.search configuration shown in the report, then reproduce the failure with min_search_length set to 3. Trace how that setting is loaded and how fuzzy search is enabled; done means the documented default remains effective and the curl request no longer returns “fuzzy search is not enabled”.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.