Skip to main content

Module query

Module query 

Source
Expand description

Distributed query implementation.

This module handles queries that span multiple shards using a two-phase TF-IDF approach:

  1. Scatter (Phase 1): Get local term frequencies from all shards
  2. Gather (Phase 2): Aggregate to global document frequencies
  3. Scatter (Phase 3): Compute TF-IDF with global DF
  4. Gather (Phase 4): Merge top-k results

Structs§

DistributedHybridConfig
Configuration for distributed hybrid queries.
DistributedQueryEngine
Distributed query engine implementing two-phase TF-IDF.

Functions§

merge_results
Merge scored results from multiple shards.
tokenize
Tokenizer matching phago-rag’s tokenizer.