surfacesearchvector_search_elastic
Searchaggregate · returns table

VECTOR_SEARCH_ELASTIC

Hybrid semantic + keyword search in Elasticsearch

Per-group — reads the whole group in one call.

searchllmtext

Arguments

nametypedescription
queryVARCHARSearch query text
source_table(optional)VARCHARFilter by source table
limit_(optional)INTEGERMax results
threshold(optional)DOUBLEMin similarity threshold 0-1
semantic_weight(optional)DOUBLEVector similarity weight
keyword_weight(optional)DOUBLEBM25 keyword weight
index_name(optional)VARCHARElasticsearch index name

About

Semantic search using Elasticsearch hybrid search (dense_vector + BM25 keywords). Combines vector similarity (70% default) with keyword matching (30% default) for better recall than pure vector search. Keywords help when exact terms matter, vectors help with semantic understanding. SQL Usage: -- Returns table directly (no JSON parsing needed) SELECT * FROM vector_search_elastic('Venezuela', 'bird_line'); SELECT * FROM vector_search_elastic('sustainable materials', 'products', 20); -- Join with source table SELECT p.*, v.similarity FROM vector_search_elastic('eco-friendly', 'products') v JOIN products p ON p.id = v.id; Returns columns: id, text, similarity, score

Nearby rabbit holes

same domain
Climb back to The Looking Glass