Search Indexer

Implement PostgreSQL full-text search indexing with tsvector and GIN indexes.

1|Updated Sep 14, 2025
One-click install
npx skills add https://github.com/CleanExpo/DR-NRPG --skill search-indexer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Search Indexer
Source: https://github.com/CleanExpo/DR-NRPG/tree/main/.skills/custom/search-indexer
Command: npx skills add https://github.com/CleanExpo/DR-NRPG --skill search-indexer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses inefficient search functionalities by implementing robust full-text indexing, query optimization, and hybrid search strategies, ensuring users find information quickly and accurately.

Core Features & Use Cases

  • Full-Text Indexing: Creates and maintains PostgreSQL tsvector indexes for efficient text searching.
  • Query Optimization: Utilizes GIN indexes and advanced query parsing (websearch_to_tsquery) for faster, more relevant results.
  • Hybrid Search: Combines full-text relevance with vector similarity for superior search quality.
  • Autocomplete: Implements prefix-based search suggestions for a better user experience.
  • Use Case: Enhance the search bar on your e-commerce platform to provide instant, accurate product suggestions and results, even for complex or misspelled queries.

Quick Start

Implement a GIN index on the 'documents' table's 'search_vector' column and update the search query to use pre-computed tsvector.

Frequently Asked Questions about Search Indexer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement full-text search indexing in PostgreSQL using tsvector and GIN indexes?

PostgreSQL full-text search indexing is implemented by creating and maintaining tsvector columns with GIN indexes to enable efficient text searching. This approach utilizes advanced query parsing like websearch_to_tsquery for faster and more relevant search results.

What is the best way to combine text search relevance with vector similarity in a hybrid search?

Hybrid search combines full-text search relevance with vector similarity to deliver superior search quality. This approach merges traditional text indexing with vector-based matching, ensuring users find information quickly and accurately even for complex queries.

How do I add search autocomplete functionality to a PostgreSQL database query?

Search autocomplete is implemented in PostgreSQL using prefix-based search suggestions. By adjusting Python query logic and utilizing GIN indexes on tsvector columns, you can provide instant prefix suggestions for a better user search experience.

Does implementing PostgreSQL search indexing require SQL schema modifications?

Yes, PostgreSQL search indexing requires SQL schema modifications to add pre-computed tsvector columns and GIN indexes. You must also adjust Python query logic to efficiently retrieve data using these optimized search vectors.

Why are my PostgreSQL full-text search queries slow and how can query optimization help?

Slow PostgreSQL full-text search queries are optimized by utilizing GIN indexes and advanced query parsing with websearch_to_tsquery. Pre-computing tsvector columns ensures faster data retrieval and significantly improves search relevance.