diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b522ae5fc587e88488b3cad25d572681404d5c..2192956ae840129cfcc443f1bd7bb6b90b88b9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/core/src/server/ValidationUtil.cpp b/core/src/server/ValidationUtil.cpp index 6debf8e0368a40e173295bbe14fe22243c23c50a..08de3286d8ee667285b7aa8a0c0be34614bd37ba 100644 --- a/core/src/server/ValidationUtil.cpp +++ b/core/src/server/ValidationUtil.cpp @@ -193,8 +193,14 @@ Status ValidateCollectionIndexType(int32_t index_type) { int engine_type = static_cast(engine::EngineType(index_type)); if (engine_type <= 0 || engine_type > static_cast(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); }