---
title: "Say when nothing fits · Agent Wranglers"
url: https://agentwranglers.se/playbook/search/relevance/say-when-nothing-fits
id: SRH-18
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 740
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Say when nothing fits

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Relevance](https://agentwranglers.se/playbook/search/relevance.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: SRH-18
- Level: Recommended
- Chapter: [Relevance](https://agentwranglers.se/playbook/search/relevance.md)
- Rule: Never pad search results with weak matches. When no result passes a set score, say so and link the full index.
- Check: Five queries on topics the site does not cover each return an empty result list and the "nothing fits" answer, with the index link.
- How: Return a score or the share of query words matched with each result. Drop results under a threshold you tune on the fixed query set. When nothing is left, answer "nothing fits" with a link to the page that lists every topic. Keep the answer text consistent with the results, so an answer never claims a match the list does not show. An agent trusts what it gets, so the doubt must be in the answer. The same idea for model answers is [Say so when nothing relevant was found](https://agentwranglers.se/playbook/ai-features/retrieval/no-match-answer.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const MIN_SCORE = 0.5;
export function answer(results, indexUrl) {
  const good = results.filter(result => result.score >= MIN_SCORE);
  return good.length ? { results: good } : { results: [], answer: 'Nothing on this site fits that question.', index: indexUrl };
}
```

### Python example

```python
MIN_SCORE = 0.5

def answer(results: list[dict], index_url: str) -> dict:
    good = [result for result in results if result["score"] >= MIN_SCORE]
    if good:
        return {"results": good}
    return {"results": [], "answer": "Nothing on this site fits that question.", "index": index_url}
```

## Related rules

- AIF-23 [Say so when nothing relevant was found](https://agentwranglers.se/playbook/ai-features/retrieval/no-match-answer.md) in AI features

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/search/relevance/say-when-nothing-fits">Agent Wranglers search playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Test search results with a fixed query set](https://agentwranglers.se/playbook/search/relevance/search-quality-tests.md)
- Next: [Watch searches that find nothing or get no click](https://agentwranglers.se/playbook/search/relevance/zero-result-searches.md)
- [Relevance](https://agentwranglers.se/playbook/search/relevance.md)
