提交 de69d51e 编写于 作者: F fishpenguin

Index type name should returned if index type is not supported

Signed-off-by: Nfishpenguin <kun.yu@zilliz.com>
上级 fad10f3e
......@@ -21,6 +21,7 @@ Please mark all changes in change log and use the issue from GitHub
- \#2696 Check the validity of the parameters of creating collection: segment_size
- \#2697 Index can not be created
- \#2698 Count entities got wrong result with binary vectors
- \#2728 Index type name should returned if index type is not supported
- \#2731 No entity returned with `get_entity_by_id`
## Feature
......
......@@ -193,8 +193,14 @@ Status
ValidateCollectionIndexType(int32_t index_type) {
int engine_type = static_cast<int>(engine::EngineType(index_type));
if (engine_type <= 0 || engine_type > static_cast<int>(engine::EngineType::MAX_VALUE)) {
std::string msg = "Invalid index type: " + std::to_string(index_type) + ". " +
"Make sure the index type is in IndexType list.";
std::string index_type_str;
for (auto it = engine::s_map_engine_type.begin(); it != engine::s_map_engine_type.end(); it++) {
if (it->second == (engine::EngineType)index_type) {
index_type_str = it->first;
}
}
std::string msg =
"Invalid index type: " + index_type_str + ". " + "Make sure the index type is in IndexType list.";
LOG_SERVER_ERROR_ << msg;
return Status(SERVER_INVALID_INDEX_TYPE, msg);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册