findNearest method
Creates a v2 vector similarity query.
Implementation
Query<T> findNearest(
String field,
Map<String, dynamic> query, {
String? metric,
int? topK,
num? threshold,
}) {
validateVectorSearchQuery(query);
if (topK != null && topK <= 0) {
throw Utils.oracledbErrorHandler(
400,
'findNearest topK must be a positive integer.',
null,
);
}
if (threshold != null && threshold.isNaN) {
throw Utils.oracledbErrorHandler(
400,
'findNearest threshold must be a number.',
null,
);
}
return withVectorSearch({
'field': field,
'query': deepClone(query),
'metric': metric,
'topK': topK,
'threshold': threshold,
});
}