Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/db/index/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ foreach(CC_SRCS ${ALL_TEST_SRCS})
core_quantizer_static
core_knn_hnsw core_knn_hnsw_sparse sparsehash
core_knn_flat core_knn_flat_sparse core_knn_ivf
core_knn_hnsw_rabitq core_mix_reducer
core_knn_hnsw_rabitq core_knn_vamana core_mix_reducer
Arrow::arrow_dataset
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
Expand Down
18 changes: 15 additions & 3 deletions tests/db/index/segment/segment_helper_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ class SegmentCompactReuseTest
p->set_is_linear(true);
return p;
}
case IndexType::VAMANA: {
auto p = std::make_shared<zvec::VamanaQueryParams>();
p->set_is_linear(true);
return p;
}
case IndexType::FLAT:
default:
return std::make_shared<zvec::FlatQueryParams>();
Expand Down Expand Up @@ -759,9 +764,9 @@ INSTANTIATE_TEST_SUITE_P(Hnsw, SegmentCompactReuseTest,

// CreateNormalSchema() only puts the test's vector_index_params on dense_fp32.
// The other 4 vector fields are hardcoded — dense_fp16/dense_int8/sparse_fp16
// are always FlatIndexParams, and sparse_fp32 gets the
// cloned params only if supports_sparse is true (utils.cc:117-124), which
// excludes IVF and HNSW_RABITQ — so for IVF it also falls back to FLAT.
// are always FlatIndexParams, and sparse_fp32 gets the cloned params only if
// supports_sparse is true (utils.cc:117-124), which excludes IVF / HNSW_RABITQ
// Vamana. For these cases the merged indexer should be FLAT.

INSTANTIATE_TEST_SUITE_P(
Ivf, SegmentCompactReuseTest,
Expand All @@ -778,6 +783,13 @@ INSTANTIATE_TEST_SUITE_P(HnswRabitq, SegmentCompactReuseTest,
IndexType::HNSW_RABITQ}));
#endif

INSTANTIATE_TEST_SUITE_P(Vamana, SegmentCompactReuseTest,
testing::Values(SegmentCompactReuseParam{
std::make_shared<VamanaIndexParams>(
MetricType::IP, 16, 100, 1.2f, false, false,
false, QuantizeType::UNDEFINED),
IndexType::VAMANA}));

TEST_F(SegmentHelperTest, CompactTask_FilterMultiSegmentsRegression) {
auto schema = test::TestHelper::CreateSchemaWithVectorIndex();
auto version_manager = CreateVersionManager(*schema);
Expand Down
6 changes: 3 additions & 3 deletions tests/db/index/utils/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ CollectionSchema::Ptr TestHelper::CreateNormalSchema(
"dense_int8", DataType::VECTOR_INT8, 128, false,
std::make_shared<FlatIndexParams>(MetricType::IP)));

// IVF and HNSW_RABITQ do not support sparse vectors, always use Flat for
// sparse fields in those cases.
// Only FLAT and HNSW support sparse vectors (see schema.cc:60-61);
// everything else uses Flat for sparse fields.
auto supports_sparse = [](const IndexParams::Ptr &params) {
auto type = params->type();
return type != IndexType::IVF && type != IndexType::HNSW_RABITQ;
return type == IndexType::FLAT || type == IndexType::HNSW;
};

IndexParams::Ptr sparse_index_params;
Expand Down