search method

Implementation

@override
Future<List<OmnixKnowledgeMatch>> search(OmnixKnowledgeQuery query) async {
  final hits = await _gateway.searchSimilar(
    query: query.text,
    topK: query.topK * candidateMultiplier,
    threshold: query.minimumScore,
  );

  return hits
      .map(_mapHit)
      .where((match) => query.allowedAccess.contains(match.chunk.access))
      .take(query.topK)
      .toList(growable: false);
}