searchChunksSemantic method
Semantic search via pgvector cosine similarity (requires embeddings).
Implementation
Future<List<ContentChunkModel>> searchChunksSemantic(
List<double> queryEmbedding, {
String? topicId,
String? domainId,
double threshold = 0.3,
int limit = 8,
}) async {
final response = await _client.rpc(
'match_chunks',
params: {
'query_embedding': queryEmbedding.toString(),
'match_topic_id': ?topicId,
'match_domain_id': ?domainId,
'match_threshold': threshold,
'match_count': limit,
},
);
return (response as List<dynamic>)
.map((row) => ContentChunkModel.fromJson(row as Map<String, dynamic>))
.toList();
}