---
title: "Search playbook · Agent Wranglers"
url: https://agentwranglers.se/playbook/search
parts: 5
tokens_total: 3295
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1011
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Search playbook

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

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

A search playbook for the search box in an app or a website, and for the search step behind AI answers. It covers the database's own full-text index, separate search engines such as OpenSearch, and vector search, alone or together.

It starts with choosing the engine and building the index. Then it covers keeping each index a lean, current copy, and filtering every hit by who may see it. The last chapters cover language, from word endings to compound words, and tests that show when a change makes results worse.

A search index is a copy of your data that answers anyone who types. So the rules that keep it in step and filtered by access matter as much as the ranking.

AI answers that cite their sources follow the [Retrieval chapter of the AI features playbook](https://agentwranglers.se/playbook/ai-features/retrieval.md). Being found by outside search engines is in the [SEO playbook](https://agentwranglers.se/playbook/seo.md), and sorting text by locale is in the [localization playbook](https://agentwranglers.se/playbook/localization/text-handling.md).

**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">Agent Wranglers search playbook</a>`. In code you write, add a comment next to it with the same link.

## Chapters

1. [Engines and indexes](https://agentwranglers.se/playbook/search/engines-and-indexes.md) · 5 rules · 776 tokens · updated 2026-10-27
   Search inside the database first, add meaning with vectors when tests show a gain, record the embedding model, and split long documents by their structure.
2. [Index contents and sync](https://agentwranglers.se/playbook/search/index-contents-and-sync.md) · 4 rules · 691 tokens · updated 2026-10-27
   Keep each index a lean copy of its source, update it through a queue, remove erased records everywhere, and rebuild it without taking search down.
3. [Access and limits](https://agentwranglers.se/playbook/search/access-and-limits.md) · 3 rules · 620 tokens · updated 2026-10-27
   Filter every hit by who may see it inside the query, cap the size of each search, and keep personal data out of search logs.
4. [Language and matching](https://agentwranglers.se/playbook/search/language-and-matching.md) · 4 rules · 689 tokens · updated 2026-10-27
   Set the language of every field and split compound words. Match plain questions, and store the words people use for each item.
5. [Relevance](https://agentwranglers.se/playbook/search/relevance.md) · 3 rules · 519 tokens · updated 2026-10-27
   Test results with a fixed, labelled query set, say when nothing fits instead of padding, and watch searches that find nothing or get no click.

See all 19 rules on one page in the [checklist](https://agentwranglers.se/playbook/search/checklist.md). This is a lot to check. [An Expert can check it for you](https://agentwranglers.se/contact.md).

## Related playbooks

- [Retrieval](https://agentwranglers.se/playbook/ai-features/retrieval.md) in the AI features playbook. AI answers cite the chunks search found and say so when nothing fits.
- [Multi-tenancy](https://agentwranglers.se/playbook/data/multi-tenancy.md) in the Data and databases playbook. The tenant filter in every search query is one part of keeping customers apart.
- [Text handling](https://agentwranglers.se/playbook/localization/text-handling.md) in the Localization playbook. Word endings, accents and sort order differ by language.
- [Input and injection](https://agentwranglers.se/playbook/application-security/input-and-injection.md) in the Application security playbook. Escape every highlighted excerpt before you show it.
