---
title: "Search · Agent Wranglers"
url: https://agentwranglers.se/playbook/data/search
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Search

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

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

> Search inside the database first, filter every hit by who may see it, and keep any separate index a lean copy. Test the results with fixed queries.

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

## Required

- DAT-61 [Filter search results by access inside the query](https://agentwranglers.se/playbook/data/search/search-access-filter): Put the user's access filter into the search query itself. Hits, totals, facet counts, suggestions and excerpts then come only from records the user may see.

## Recommended

- DAT-60 [Search with the database's own full-text index](https://agentwranglers.se/playbook/data/search/database-full-text-search): Serve keyword search from a full-text index inside the database. Never search long text with `LIKE '%word%'`, which reads every row.
- DAT-62 [Index only the fields people search](https://agentwranglers.se/playbook/data/search/search-index-fields): Keep a written list of the fields each search index holds, and leave out every field nobody searches. Delete a record's index entry in the same job that deletes or erases the record.
- DAT-63 [Set the language of every search field](https://agentwranglers.se/playbook/data/search/search-language): Choose the language rules for each searched field on purpose. Test word endings, accents and typos with a fixed list of word pairs.
- DAT-64 [Cap the size of every search](https://agentwranglers.se/playbook/data/search/search-limits): Reject search text over a fixed length, such as 200 characters, and return a fixed number of hits per page. Stop deep paging at a fixed depth, such as 1,000 hits.
- DAT-65 [Test search results with a fixed query set](https://agentwranglers.se/playbook/data/search/search-quality-tests): Keep a set of the searches people make, each with the records it must find. Fail the build when a change pushes an expected record out of the top 10.

- Previous: [Product analytics](https://agentwranglers.se/playbook/data/product-analytics)
- [All chapters](https://agentwranglers.se/playbook/data)
