search

Filter UI that syncs query params via Stimulus (no front-end router)

Filters are better when the URL reflects state. I use a small Stimulus controller that updates the query string as filters change, then triggers a Turbo visit (often with data-turbo-action='replace'). This gives shareable URLs and correct back-button

Debounced live search with Stimulus + Turbo Streams

For search-as-you-type, I keep the server in charge and use a small Stimulus controller to debounce form submission. The controller listens to input events, waits ~250ms, then triggers a normal Turbo form submit. The server responds with index.turbo_s

Safer Background Reindex: slice batches + checkpoints

Full reindexes can be long and fragile. Add checkpoints (last processed id), process in batches, and make it resumable. That turns a scary operation into a routine one.

Stimulus: debounced search that plays nicely with Turbo

Client-side debounce is best done in Stimulus (not in view helpers). This controller submits the nearest form after a short pause, while letting Turbo handle the navigation and frame replacement.

Django haystack for advanced search

Haystack provides unified search across backends (Elasticsearch, Solr, Whoosh). I define search indexes mapping models to searchable fields. It handles full-text search, faceting, and highlighting. The SearchQuerySet API is similar to Django's ORM. I

Multi-Column Full Text Search with tsvector

For Postgres search beyond trivial ILIKE, maintain a tsvector column and a GIN index. Update it via trigger or application logic. This keeps search fast and predictable even as your dataset grows.