mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: make json path index non exists offsets compatible with 2.5 (#43691)
issue: https://github.com/milvus-io/milvus/issues/43666 --------- Signed-off-by: sunby <sunbingyi1992@gmail.com>
This commit is contained in:
parent
bdd65871ea
commit
b59bc5e2c0
@ -52,8 +52,8 @@ class PhyExistsFilterExpr : public SegmentExpr {
|
||||
DataType::NONE,
|
||||
active_count,
|
||||
batch_size,
|
||||
true,
|
||||
consistency_level),
|
||||
consistency_level,
|
||||
true),
|
||||
expr_(expr) {
|
||||
}
|
||||
|
||||
|
||||
@ -97,6 +97,7 @@ template <typename T>
|
||||
void
|
||||
JsonInvertedIndex<T>::LoadIndexMetas(
|
||||
const std::vector<std::string>& index_files, const Config& config) {
|
||||
InvertedIndexTantivy<T>::LoadIndexMetas(index_files, config);
|
||||
auto fill_non_exist_offset = [&](const uint8_t* data, int64_t size) {
|
||||
non_exist_offsets_.resize((size_t)size / sizeof(size_t));
|
||||
memcpy(non_exist_offsets_.data(), data, (size_t)size);
|
||||
@ -138,8 +139,16 @@ JsonInvertedIndex<T>::LoadIndexMetas(
|
||||
fill_non_exist_offset(non_exist_offset_codec->PayloadData(),
|
||||
non_exist_offset_codec->PayloadSize());
|
||||
}
|
||||
return;
|
||||
}
|
||||
InvertedIndexTantivy<T>::LoadIndexMetas(index_files, config);
|
||||
|
||||
// Fallback: no non_exist_offset_file found. This occurs in two scenarios:
|
||||
// 1. Legacy v2.5.x data where non_exist_offset_file doesn't exist
|
||||
// 2. All records are valid (no invalid offsets to track)
|
||||
//
|
||||
// Use null_offset_ as the source for non_exist_offsets_ to maintain
|
||||
// backward compatibility. This ensures Exists() behaves like v2.5.x IsNotNull().
|
||||
non_exist_offsets_ = this->null_offset_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user