diff --git a/internal/core/src/exec/expression/ExistsExpr.h b/internal/core/src/exec/expression/ExistsExpr.h index 1fec19065f..9d646460bc 100644 --- a/internal/core/src/exec/expression/ExistsExpr.h +++ b/internal/core/src/exec/expression/ExistsExpr.h @@ -52,8 +52,8 @@ class PhyExistsFilterExpr : public SegmentExpr { DataType::NONE, active_count, batch_size, - true, - consistency_level), + consistency_level, + true), expr_(expr) { } diff --git a/internal/core/src/index/JsonInvertedIndex.cpp b/internal/core/src/index/JsonInvertedIndex.cpp index c015f77d49..65a037bc3d 100644 --- a/internal/core/src/index/JsonInvertedIndex.cpp +++ b/internal/core/src/index/JsonInvertedIndex.cpp @@ -97,6 +97,7 @@ template void JsonInvertedIndex::LoadIndexMetas( const std::vector& index_files, const Config& config) { + InvertedIndexTantivy::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::LoadIndexMetas( fill_non_exist_offset(non_exist_offset_codec->PayloadData(), non_exist_offset_codec->PayloadSize()); } + return; } - InvertedIndexTantivy::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