diff --git a/src/db/index/common/schema.cc b/src/db/index/common/schema.cc index ef50bf9..02789c6 100644 --- a/src/db/index/common/schema.cc +++ b/src/db/index/common/schema.cc @@ -120,9 +120,7 @@ Status FieldSchema::validate() const { support_dense_vector_index.end()) { return Status::InvalidArgument( "schema validate failed: dense_vector's index_params only " - "support FLAT|HNSW " - "index, " - "but field[", + "support FLAT|HNSW|IVF index, but field[", name_, "]'s index_type is ", IndexTypeCodeBook::AsString(index_params_->type())); } @@ -199,15 +197,23 @@ std::string FieldSchema::to_string() const { std::string FieldSchema::to_string_formatted(int indent_level) const { std::ostringstream oss; - oss << indent(indent_level) << "FieldSchema{\n" - << indent(indent_level + 1) << "name: '" << name_ << "',\n" - << indent(indent_level + 1) - << "data_type: " << DataTypeCodeBook::AsString(data_type_) << ",\n" - << indent(indent_level + 1) - << "nullable: " << (nullable_ ? "true" : "false") << ",\n"; + if (is_vector_field()) { + oss << indent(indent_level) << "FieldSchema[vector]{\n"; + } else { + oss << indent(indent_level) << "FieldSchema[scalar]{\n"; + } - if (dimension_ != 0) { - oss << indent(indent_level + 1) << "dimension: " << dimension_ << ",\n"; + oss << indent(indent_level + 1) << "name: '" << name_ << "',\n" + << indent(indent_level + 1) + << "data_type: " << DataTypeCodeBook::AsString(data_type_) << ",\n"; + + if (is_vector_field()) { + if (is_dense_vector()) { + oss << indent(indent_level + 1) << "dimension: " << dimension_ << ",\n"; + } + } else { + oss << indent(indent_level + 1) + << "nullable: " << (nullable_ ? "true" : "false") << ",\n"; } if (index_params_) { diff --git a/src/db/index/common/type_helper.h b/src/db/index/common/type_helper.h index 967a8b1..71ce4a7 100644 --- a/src/db/index/common/type_helper.h +++ b/src/db/index/common/type_helper.h @@ -320,6 +320,12 @@ struct DataTypeCodeBook { case DataType::VECTOR_INT16: data_type = "VECTOR_INT16"; break; + case DataType::SPARSE_VECTOR_FP16: + data_type = "SPARSE_VECTOR_FP16"; + break; + case DataType::SPARSE_VECTOR_FP32: + data_type = "SPARSE_VECTOR_FP32"; + break; case DataType::ARRAY_BINARY: data_type = "ARRAY_BINARY"; break; diff --git a/src/include/zvec/db/index_params.h b/src/include/zvec/db/index_params.h index 4bfa3bf..dc0a22a 100644 --- a/src/include/zvec/db/index_params.h +++ b/src/include/zvec/db/index_params.h @@ -269,8 +269,7 @@ class IVFIndexParams : public VectorIndexParams { auto base_str = vector_index_params_to_string("IVFIndexParams", metric_type_, quantize_type_); std::ostringstream oss; - oss << base_str << ",n_list:" << n_list_ << ",n_iters:" << n_iters_ - << ",use_soar:" << use_soar_ << " << "; + oss << base_str << ",n_list:" << n_list_ << ",n_iters:" << n_iters_ << "}"; return oss.str(); }