From 243e843aace77a40a322907c3f7ef967bfc7d66d Mon Sep 17 00:00:00 2001 From: Tinkerrr Date: Thu, 26 Mar 2020 18:28:24 +0800 Subject: [PATCH] fix #1747 (#1757) * fix Signed-off-by: Nicky * update. Signed-off-by: Nicky * lint pass Signed-off-by: xiaojun.lin * UPDATE CASE: search with tag not exist Signed-off-by: zw Co-authored-by: zw --- CHANGELOG.md | 1 + core/src/db/DBImpl.cpp | 9 ++++++++- core/src/utils/Error.h | 1 + tests/milvus_python_test/test_search_vectors.py | 3 +-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7335e4b46..a8e532d138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Please mark all change in change log and use the issue from GitHub - \#1728 Optimize request handler to combine similar query - \#1734 Opentracing for combined search request - \#1735 Fix search out of memory with ivf_flat +- \#1747 Expected error status if search with partition_tag not existed - \#1756 Fix memory exhausted during searching ## Feature diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 7fef4b5407..cbb70b9466 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -1130,7 +1130,10 @@ DBImpl::Query(const std::shared_ptr& context, const std::string } else { // get files from specified partitions std::set partition_name_array; - GetPartitionsByTags(table_id, partition_tags, partition_name_array); + status = GetPartitionsByTags(table_id, partition_tags, partition_name_array); + if (!status.ok()) { + return status; // didn't match any partition. + } for (auto& partition_name : partition_name_array) { status = GetFilesToSearch(partition_name, files_array); @@ -1665,6 +1668,10 @@ DBImpl::GetPartitionsByTags(const std::string& table_id, const std::vector