hybrid-search-implementation

Combine vector and keyword search with RRF fusion in PostgreSQL and Elasticsearch.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/NOMARJ/nomark-method --skill hybrid-search-implementation-nomarj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hybrid-search-implementation
Source: https://github.com/NOMARJ/nomark-method/tree/main/claude/skills/llm/hybrid-search-implementation
Command: npx skills add https://github.com/NOMARJ/nomark-method --skill hybrid-search-implementation-nomarj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the limitations of relying solely on vector or keyword search by providing robust methods to combine both, leading to more comprehensive and accurate search results.

Core Features & Use Cases

  • Enhanced Retrieval: Improves recall in RAG systems and search engines by leveraging the strengths of both semantic and lexical matching.
  • Flexible Fusion: Supports multiple fusion techniques like Reciprocal Rank Fusion (RRF) and linear combination, allowing for tunable performance.
  • Database Integration: Provides templates for integrating hybrid search into PostgreSQL with pgvector and Elasticsearch.
  • Use Case: When building a knowledge base search, use this Skill to ensure that queries like "What is the Q3 financial report?" retrieve documents based on semantic understanding of "financial report" and also exact matches for "Q3".

Quick Start

Implement hybrid search using the provided Python templates for PostgreSQL or Elasticsearch.

Frequently Asked Questions about hybrid-search-implementation

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

FAQPage Schema
How do I combine vector and keyword search to improve RAG recall?

Combine vector and keyword search using fusion methods like Reciprocal Rank Fusion (RRF) or linear combination to improve RAG recall. This leverages both semantic understanding and exact lexical matching for more comprehensive results.

What is the best way to implement hybrid search in PostgreSQL?

The best way to implement hybrid search in PostgreSQL is by using the pgvector extension for vector search alongside standard keyword indexing. This Skill provides Python templates to fuse these results for enhanced retrieval accuracy.

Does Elasticsearch support reciprocal rank fusion for hybrid search?

Yes, Elasticsearch supports hybrid search. You can combine vector and keyword search techniques using fusion methods like Reciprocal Rank Fusion (RRF) and linear combination to tune retrieval performance and accuracy.

When do I need hybrid search instead of just vector search?

You need hybrid search when queries require both semantic understanding and exact term matching. For example, searching for a Q3 financial report benefits from semantic matching of financial terms and exact lexical matching of Q3.

Can I tune the fusion weights between vector and keyword search?

Yes, you can tune fusion weights between vector and keyword search. The Skill supports flexible fusion techniques including linear combination, allowing you to adjust parameters for optimal retrieval performance based on your specific use case.

What are the limitations of using linear combination for search fusion?

Linear combination for search fusion requires score normalization across vector and keyword search results before weighting. Unlike Reciprocal Rank Fusion (RRF), it demands careful parameter tuning to prevent one scoring method from dominating the other.