Introduction

Hybrid search combines full-text and semantic search to deliver more comprehensive and relevant results. This technique leverages the strengths of traditional keyword-based searching and modern vector embeddings’ contextual understanding. In R2R, hybrid search is implemented using SQL functions and vector operations, enabling efficient and accurate searches over large datasets.

Setup

This guide assumes R2R is already installed and the basic quickstart has been completed.

To populate the database with sample files:

python -m r2r.examples.quickstart ingest_as_files --no-media=true

Run a basic search:

python -m r2r.examples.quickstart search --query="What is a fierce nerd?" 

To execute a hybrid search:

python -m r2r.examples.quickstart search --query="What is a fierce nerd?" --do_hybrid_search

How Hybrid Search Works

Summary

Hybrid search in R2R combines the strengths of traditional keyword-based searching and modern semantic understanding. By integrating full-text and vector-based searches, it provides more contextually accurate and comprehensive results, particularly for complex queries.

For more information on R2R’s capabilities, visit the R2R GitHub repository or join the R2R Discord community.