Loading...
Loading...
Compare original and translation side by side
bash scripts/setup-pgvector.sh [SUPABASE_DB_URL]bash scripts/setup-pgvector.sh [SUPABASE_DB_URL]# Copy template and customize for your use case
cat templates/embedding-table-schema.sqlpsql $SUPABASE_DB_URL < templates/embedding-table-schema.sql# 复制模板并根据你的用例自定义
cat templates/embedding-table-schema.sqlpsql $SUPABASE_DB_URL < templates/embedding-table-schema.sqlbash scripts/create-indexes.sh hnsw [TABLE_NAME] [DIMENSION]bash scripts/create-indexes.sh ivfflat [TABLE_NAME] [DIMENSION]bash scripts/create-indexes.sh hnsw [TABLE_NAME] [DIMENSION]bash scripts/create-indexes.sh ivfflat [TABLE_NAME] [DIMENSION]-- See templates/match-function.sql for complete example
create or replace function match_documents(
query_embedding vector(1536)
match_threshold float
match_count int
) returns setof documents ...const { data } = await supabase.rpc('match_documents', {
query_embedding: embedding
match_threshold: 0.78
match_count: 10
});-- 查看templates/match-function.sql获取完整示例
create or replace function match_documents(
query_embedding vector(1536)
match_threshold float
match_count int
) returns setof documents ...const { data } = await supabase.rpc('match_documents', {
query_embedding: embedding
match_threshold: 0.78
match_count: 10
});bash scripts/setup-hybrid-search.sh [TABLE_NAME]select * from hybrid_search(
'search query text'
query_embedding
match_count := 10
full_text_weight := 1.0
semantic_weight := 1.0
);bash scripts/setup-hybrid-search.sh [TABLE_NAME]select * from hybrid_search(
'search query text'
query_embedding
match_count := 10
full_text_weight := 1.0
semantic_weight := 1.0
);bash scripts/test-vector-search.sh [TABLE_NAME]bash scripts/test-vector-search.sh [TABLE_NAME]<=><#><-><=><#><->EXPLAIN ANALYZEEXPLAIN ANALYZEscripts/setup-pgvector.shscripts/create-indexes.shscripts/setup-hybrid-search.shscripts/test-vector-search.shtemplates/embedding-table-schema.sqltemplates/hnsw-index-config.sqltemplates/ivfflat-index-config.sqltemplates/hybrid-search-function.sqltemplates/match-function.sqlexamples/embedding-strategies.mdexamples/vector-search-examples.mdexamples/document-search-pattern.mdexamples/preference-matching-pattern.mdexamples/product-recommendations-pattern.mdscripts/setup-pgvector.shscripts/create-indexes.shscripts/setup-hybrid-search.shscripts/test-vector-search.shtemplates/embedding-table-schema.sqltemplates/hnsw-index-config.sqltemplates/ivfflat-index-config.sqltemplates/hybrid-search-function.sqltemplates/match-function.sqlexamples/embedding-strategies.mdexamples/vector-search-examples.mdexamples/document-search-pattern.mdexamples/preference-matching-pattern.mdexamples/product-recommendations-pattern.md