avoid checking search params many times (#21516)

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/21564/head
yah01 2023-01-06 13:15:35 +08:00 committed by GitHub
parent b3da554705
commit e8e2696430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -93,6 +93,8 @@ SearchOnGrowing(const segcore::SegmentGrowingImpl& segment,
// step 1.2: get which vector field to search
auto vecfield_id = info.field_id_;
auto& field = schema[vecfield_id];
CheckBruteForceSearchParam(field, info);
auto data_type = field.get_data_type();
AssertInfo(datatype_is_vector(data_type), "[SearchOnGrowing]Data type isn't vector type");
@ -123,7 +125,6 @@ SearchOnGrowing(const segcore::SegmentGrowingImpl& segment,
auto size_per_chunk = element_end - element_begin;
auto sub_view = bitset.subview(element_begin, size_per_chunk);
CheckBruteForceSearchParam(field, info);
auto sub_qr = BruteForceSearch(search_dataset, chunk_data, size_per_chunk, sub_view);
// convert chunk uid to segment uid