From aa0b416ef546e5cdf59d9df0c37549eba02d3a66 Mon Sep 17 00:00:00 2001 From: JinHai-CN Date: Wed, 11 Mar 2020 14:03:09 +0800 Subject: [PATCH] Update code Signed-off-by: JinHai-CN --- sdk/examples/simple/src/ClientTest.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sdk/examples/simple/src/ClientTest.cpp b/sdk/examples/simple/src/ClientTest.cpp index 06161166..fb2e2b13 100644 --- a/sdk/examples/simple/src/ClientTest.cpp +++ b/sdk/examples/simple/src/ClientTest.cpp @@ -31,7 +31,7 @@ constexpr int64_t NQ = 5; constexpr int64_t TOP_K = 10; constexpr int64_t NPROBE = 32; constexpr int64_t SEARCH_TARGET = 5000; // change this value, result is different -constexpr int64_t ADD_ENTITY_LOOP = 50; +constexpr int64_t ADD_ENTITY_LOOP = 5; constexpr milvus::IndexType INDEX_TYPE = milvus::IndexType::IVFSQ8; constexpr int32_t NLIST = 16384; @@ -245,19 +245,15 @@ ClientTest::Test() { Flush(collection_name); ShowCollectionInfo(collection_name); -// GetEntityById(collection_name, search_id_array_[0]); -// SearchEntities(collection_name, TOP_K, NPROBE); -// -// CreateIndex(collection_name, INDEX_TYPE, NLIST); -// ShowCollectionInfo(collection_name); -// -// PreloadCollection(collection_name); + GetEntityById(collection_name, search_id_array_[0]); + SearchEntities(collection_name, TOP_K, NPROBE); - constexpr long vector_size = 2000000; - std::vector delete_ids(vector_size); // = {search_id_array_[0], search_id_array_[1]}; - for(long i= 0; i < vector_size; ++ i) { - delete_ids[i] = i; - } + CreateIndex(collection_name, INDEX_TYPE, NLIST); + ShowCollectionInfo(collection_name); + + PreloadCollection(collection_name); + + std::vector delete_ids = {search_id_array_[0], search_id_array_[1]}; DeleteByIds(collection_name, delete_ids); SearchEntities(collection_name, TOP_K, NPROBE); // this line get two search error since we delete two entities -- GitLab