mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: Get R-Tree index correct for growing segment (#44612)
issue: #43427 R-Tree index is the entire segment, not the chunk. Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
a110d8cc49
commit
9d1bb8497c
@ -397,6 +397,23 @@ class SegmentGrowingImpl : public SegmentGrowing {
|
||||
if (!HasIndex(field_id)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto& field_meta = schema_->operator[](field_id);
|
||||
|
||||
// For geometry fields, return segment-level index (RTree doesn't use chunks)
|
||||
if (IsGeometryType(field_meta.get_data_type())) {
|
||||
auto segment_index = indexing_record_.get_field_indexing(field_id)
|
||||
.get_segment_indexing();
|
||||
if (segment_index.get() != nullptr) {
|
||||
// Convert from PinWrapper<index::IndexBase*> to PinWrapper<const index::IndexBase*>
|
||||
return {
|
||||
PinWrapper<const index::IndexBase*>(segment_index.get())};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// For vector fields, return chunk-level indexes
|
||||
auto num_chunk = num_chunk_index(field_id);
|
||||
std::vector<PinWrapper<const index::IndexBase*>> indexes;
|
||||
for (int64_t i = 0; i < num_chunk; i++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user