Full-Text Search Implementation
Implement fast full-text search using PostgreSQL without external tools
Implement full-text search in PostgreSQL for: **Table:** [TABLE_NAME] **Searchable columns:** [COLUMNS — e.g., "title, description, tags, author_name"] **Features needed:** [FEATURES — e.g., "fuzzy matching, ranking, highlighting, autocomplete"] Generate: 1. **tsvector column** — generated column combining searchable fields with weights 2. **GIN index** — index for fast full-text queries 3. **Search query** — ts_query with ranking by relevance 4. **Fuzzy matching** — pg_trgm for typo-tolerant search 5. **Autocomplete** — prefix matching for search-as-you-type 6. **Highlighting** — ts_headline for showing matched snippets 7. **API endpoint** — complete endpoint with pagination and filters 8. **Performance** — benchmark queries and optimization tips Include the migration SQL, search function, and API route code.
How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More Database Prompts
Related database templates from the vault
Database Normalization Advisor
Use this prompt to database normalization advisor with AI assistance
Query Result Caching Strategy
Use this prompt to query result caching strategy with AI assistance
Database Schema Designer
Design a normalized database schema from application requirements
Database Sharding Strategy Designer
PRODesign a database sharding strategy with shard key selection, routing logic, and migration plan from a single database
You Might Also Like
Prompts from other categories that share similar tags
Database Query Performance Analyzer
Analyze slow database queries and generate optimized alternatives
API Response Caching Layer
Use this prompt to api response caching layer with AI assistance
Load Testing Script Generator
Generate load test scripts to validate API performance under stress
Database Deadlock Resolver
Use this prompt to database deadlock resolver with AI assistance
Keep Exploring the Vault