language sql stable as $$ select documents.id, documents.content, 1 - (documents.embedding <=> query_embedding) as similarity from documents where documents.embedding <=> query_embedding < 1 - match_threshold order by documents.embedding <=> query_embedding limit match_count; $$;