未验证 提交 243e843a 编写于 作者: T Tinkerrr 提交者: GitHub

fix #1747 (#1757)

* fix
Signed-off-by: NNicky <nicky.xj.lin@gmail.com>

* update.
Signed-off-by: NNicky <nicky.xj.lin@gmail.com>

* lint pass
Signed-off-by: Nxiaojun.lin <xiaojun.lin@zilliz.com>

* UPDATE CASE: search with tag not exist
Signed-off-by: Nzw <zw@zilliz.com>
Co-authored-by: Nzw <zw@zilliz.com>
上级 e9f7422b
......@@ -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
......
......@@ -1130,7 +1130,10 @@ DBImpl::Query(const std::shared_ptr<server::Context>& context, const std::string
} else {
// get files from specified partitions
std::set<std::string> 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<std::
}
}
if (partition_name_array.empty()) {
return Status(PARTITION_NOT_FOUND, "Cannot find the specified partitions");
}
return Status::OK();
}
......
......@@ -93,6 +93,7 @@ constexpr ErrorCode DB_INCOMPATIB_META = ToDbErrorCode(6);
constexpr ErrorCode DB_INVALID_META_URI = ToDbErrorCode(7);
constexpr ErrorCode DB_EMPTY_TABLE = ToDbErrorCode(8);
constexpr ErrorCode DB_BLOOM_FILTER_ERROR = ToDbErrorCode(9);
constexpr ErrorCode PARTITION_NOT_FOUND = ToDbErrorCode(10);
// knowhere error code
constexpr ErrorCode KNOWHERE_ERROR = ToKnowhereErrorCode(1);
......
......@@ -327,8 +327,7 @@ class TestSearchBase:
search_param = get_search_param(index_type)
status, result = connect.search_vectors(collection, top_k, query_vec, partition_tags=["new_tag"], params=search_param)
logging.getLogger().info(result)
assert status.OK()
assert len(result) == 0
assert not status.OK()
def test_search_l2_index_params_partition_E(self, connect, collection, get_simple_index):
'''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册