fts-relaxation-capped-at-fifty-queries

IN premise

`_fts_search` caps progressive term relaxation at 50 FTS5 queries to prevent combinatorial explosion on long search inputs, dropping terms one at a time via `combinations` down to `len(terms) // 2`.

Summary

When someone searches with many words, the full-text search function tries progressively shorter combinations of those words to find partial matches. To avoid runaway performance costs, it stops after 50 query attempts and only relaxes down to half the original terms, so a ten-word search never tries single-word fallbacks.

Details

Sourceentries/2026/05/08/reasons_lib-api.md