Vector Search
Vector search settings can be configured both server-side and at runtime. Runtime settings are passed as a dictionary to the search and RAG endpoints. You may refer to the search API documentation here for additional materials.
Example using the Python SDK:
Configurable Parameters
VectorSearchSettings
use_vector_search
(bool): Whether to use vector searchuse_hybrid_search
(bool): Whether to perform a hybrid search (combining vector and keyword search)filters
(dict): Alias for filterssearch_filters
(dict): Filters to apply to the vector searchsearch_limit
(int): Maximum number of results to return (1-1000)selected_collection_ids
(list[UUID]): Collection Ids to search forindex_measure
(IndexMeasure): The distance measure to use for indexing (cosine_distance, l2_distance, or max_inner_product)include_values
(bool): Whether to include search score values in the search resultsinclude_metadatas
(bool): Whether to include element metadata in the search resultsprobes
(Optional[int]): Number of ivfflat index lists to query (default: 10)ef_search
(Optional[int]): Size of the dynamic candidate list for HNSW index search (default: 40)hybrid_search_settings
(Optional[HybridSearchSettings]): Settings for hybrid search
HybridSearchSettings
full_text_weight
(float): Weight to apply to full text search (default: 1.0)semantic_weight
(float): Weight to apply to semantic search (default: 5.0)full_text_limit
(int): Maximum number of results to return from full text search (default: 200)rrf_k
(int): K-value for RRF (Rank Reciprocal Fusion) (default: 50)
Advanced Filtering
R2R supports complex filtering using PostgreSQL-based queries. Allowed operators include:
eq
,neq
: Equality and inequalitygt
,gte
,lt
,lte
: Greater than, greater than or equal, less than, less than or equallike
,ilike
: Pattern matching (case-sensitive and case-insensitive)in
,nin
: Inclusion and exclusion in a list of values
Example of advanced filtering: