Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
aoiasd committed Dec 24, 2024
1 parent 56d3b5f commit c0a3f56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/core/src/query/SearchBruteForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ BruteForceSearch(const dataset::SearchDataset& query_ds,
auto [query_dataset, base_dataset] =
PrepareBFDataSet(query_ds, raw_ds, data_type);
auto search_cfg = PrepareBFSearchParams(search_info, index_info);
LOG_INFO("test-- BruteForce Param: {}", search_cfg.dump());
// `range_search_k` is only used as one of the conditions for iterator early termination.
// not gurantee to return exactly `range_search_k` results, which may be more or less.
// set it to -1 will return all results in the range.
Expand All @@ -123,6 +124,7 @@ BruteForceSearch(const dataset::SearchDataset& query_ds,
sub_result.mutable_distances().resize(nq * topk);

if (search_cfg.contains(RADIUS)) {
LOG_INFO("test-- BruteForce RADIUS");
if (search_cfg.contains(RANGE_FILTER)) {
CheckRangeSearchParam(search_cfg[RADIUS],
search_cfg[RANGE_FILTER],
Expand Down Expand Up @@ -160,6 +162,7 @@ BruteForceSearch(const dataset::SearchDataset& query_ds,
KnowhereStatusString(res.error()),
res.what());
}
LOG_INFO("test-- BruteForce RADIUS SUCCESS");
auto result =
ReGenRangeSearchResult(res.value(), topk, nq, query_ds.metric_type);
milvus::tracer::AddEvent("ReGenRangeSearchResult");
Expand All @@ -168,6 +171,7 @@ BruteForceSearch(const dataset::SearchDataset& query_ds,
std::copy_n(
GetDatasetDistance(result), nq * topk, sub_result.get_distances());
} else {
LOG_INFO("test-- BruteForce ELSE");
knowhere::Status stat;
if (data_type == DataType::VECTOR_FLOAT) {
stat = knowhere::BruteForce::SearchWithBuf<float>(
Expand Down Expand Up @@ -221,6 +225,7 @@ BruteForceSearch(const dataset::SearchDataset& query_ds,
PanicInfo(KnowhereError,
"Brute force search fail: " + KnowhereStatusString(stat));
}
LOG_INFO("test-- BruteForce ELSE SUCCESS");
}
sub_result.round_values();
return sub_result;
Expand Down

0 comments on commit c0a3f56

Please sign in to comment.