Cursor prompt
Implement Search with Filtering
Full-text search with faceted filters, cursor pagination, debounced UI, and URL-persisted state.
Implement search for {{entity}} in {{project_name}}. ## Search fields: {{searchable_fields}} ## Filter dimensions: {{filter_options}} ## Database: {{database}} ### Backend: Search API GET /api/search?q=&filters=&sort=&cursor=&limit= - Full-text search using PostgreSQL tsvector with GIN index - Filter support: exact match, multi-select (OR within dimension, AND across dimensions) - Sort by: relevance (default), newest, oldest, {{sort_options}} - Cursor-based pagination for consistency with live data - Highlight matching terms: wrap matched text in <mark> tags ### PostgreSQL Full-Text Index ```sql CREATE INDEX idx_{{table}}_search ON {{table}} USING GIN(to_tsvector('english', coalesce({{tsvector_columns}}, '') )); ``` Update tsvector on write via application logic or DB trigger. ### Frontend: Search UI - Debounce input: 300ms before firing API call - Persist q + filters in URL query params (shareable, back-button friendly) - Show total result count: "42 results" - Filter sidebar: instant apply, no submit button needed - Skeleton loading during search - Empty state: "No results for '{{q}}'" with search suggestions ### Performance - Cache frequent search results in Redis for 60 seconds - Return only needed projection fields from DB (no SELECT *) ### Output Search API route, useSearch hook, filter sidebar component, results list.
Fill in: {{entity}}, {{project_name}}, {{searchable_fields}}, {{filter_options}}, {{database}}, {{sort_options}}, {{table}}, {{tsvector_columns}}, {{q}}. In Loopy you fill these in a form and copy the finished prompt in one click.
More coding prompts
- CursorAdd File Upload with Cloud StorageMulti-file upload with type checking, size limits, virus scanning, cloud storage, and progress tracking.
- CursorAdd Redis Caching LayerCache-aside Redis caching with typed get/set helpers, TTL management, pattern-based invalidation, and monitoring.
- CursorAdd Stripe Payment IntegrationComplete Stripe checkout, webhooks, subscription management, and billing portal with idempotent webhook handling.
- LovableBooking and Scheduling SystemCalendar-based booking with availability management, confirmations, reminders, and payment collection.
- CursorBuild Admin Dashboard with CRUDData table with server-side CRUD, column sorting and filtering, bulk actions, and role-protected admin panel.
- CursorBuild Data Export FeatureExport large datasets to CSV or Excel with streaming for memory efficiency, background jobs, and signed download links.

