test: [cherry-pick] Fix index creation mismatch for sparse vector columns in multivector case (#34620)

pr: https://github.com/milvus-io/milvus/pull/34618

Signed-off-by: elstic <hao.wang@zilliz.com>
This commit is contained in:
elstic 2024-07-16 09:39:38 +08:00 committed by GitHub
parent 274790b187
commit 40f6febf9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -299,7 +299,11 @@ class TestcaseBase(Base):
if len(multiple_dim_array) == 0 or is_all_data_type == False:
vector_name_list.append(ct.default_float_vec_field_name)
for vector_name in vector_name_list:
collection_w.create_index(vector_name, ct.default_flat_index)
# Unlike dense vectors, sparse vectors cannot create flat index.
if ct.sparse_vector in vector_name:
collection_w.create_index(vector_name, ct.default_sparse_inverted_index)
else:
collection_w.create_index(vector_name, ct.default_flat_index)
collection_w.load()