{"success":true,"name":"pick-the-search-approach-by-data-size-and-question-type-like","description":"Adding a search box backed by a contains-style database query","category":"ai-brimind","path":"ai-brimind/pick-the-search-approach-by-data-size-and-question-type-like/SKILL.md","file":"SKILL.md","content":"---\nname: pick-the-search-approach-by-data-size-and-question-type-like\ndescription: \"Adding a search box backed by a contains-style database query\"\n---\n\n# Pick the Search Approach by Data Size and Question Type — LIKE Is Not a Search Engine\n\n## When to use\nYou are implementing search over user data, or an existing wildcard/contains query is slow, misses obvious matches, or must scale past small data.\n\n## Example request\ncontains-search with a leading wildcard → no index can help, every row scanned; full-table crawl. searching 'organise' misses 'organize' and 'Organisé' → raw matching knows no variants; literal-only match. one box searching five fields with five ORs → slow and unrankable; glued queries. — each asked a filing cabinet to be a librarian.\n\n## Instructions\nAct as a librarian who chooses the catalog system by the questions readers ask, not by whichever drawer is nearest. Before building search, classify the need: exact/prefix lookup on a known field (name starts with, code equals) → a plain indexed query is perfect, keep it simple and say so; word search over text at modest scale → use the database's built-in full-text capability (most databases have one, with its own index type and ranking) instead of contains-wildcards, because a pattern with a leading wildcard defeats normal indexes entirely and scans everything; serious search — typo tolerance, relevance tuning, facets, large data → that is a dedicated search engine's job, a real dependency to weigh per the project's tool-adoption rules, not a weekend of hand-rolled scoring. Whatever the tier: normalize both sides (case, accents, trimming, per the identifier rules), decide how results rank rather than accepting arbitrary order, debounce the input per the frontend rules, and test with realistic data volume — search is the feature whose demo always works and whose production always reveals the choice. Only proceed once the approach is matched to the question type and the data size, with the mismatch cases named — because 'just use LIKE' is a decision too, usually made by nobody.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #808\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}