mirror of https://github.com/milvus-io/milvus.git
parent
013a1f0e7d
commit
a8925ca6e7
|
@ -30,11 +30,11 @@ constexpr milvus::MetricType COLLECTION_METRIC_TYPE = milvus::MetricType::L2;
|
|||
constexpr int64_t BATCH_ENTITY_COUNT = 10000;
|
||||
constexpr int64_t NQ = 5;
|
||||
constexpr int64_t TOP_K = 10;
|
||||
constexpr int64_t NPROBE = 32;
|
||||
constexpr int64_t NPROBE = 16;
|
||||
constexpr int64_t SEARCH_TARGET = BATCH_ENTITY_COUNT / 2; // change this value, result is different
|
||||
constexpr int64_t ADD_ENTITY_LOOP = 10;
|
||||
constexpr milvus::IndexType INDEX_TYPE = milvus::IndexType::IVFFLAT;
|
||||
constexpr int32_t NLIST = 16384;
|
||||
constexpr int32_t NLIST = 1024;
|
||||
const char* PARTITION_TAG = "part";
|
||||
const char* DIMENSION = "dim";
|
||||
const char* METRICTYPE = "metric_type";
|
||||
|
@ -114,6 +114,7 @@ ClientTest::CreateCollection(const std::string& collection_name) {
|
|||
|
||||
JSON extra_params;
|
||||
extra_params["segment_row_count"] = 1024;
|
||||
extra_params["auto_id"] = false;
|
||||
milvus::Mapping mapping = {collection_name, {field_ptr1, field_ptr2, field_ptr3, field_ptr4}};
|
||||
|
||||
milvus::Status stat = conn_->CreateCollection(mapping, extra_params.dump());
|
||||
|
@ -140,7 +141,6 @@ ClientTest::InsertEntities(const std::string& collection_name) {
|
|||
milvus_sdk::Utils::BuildEntities(begin_index, begin_index + BATCH_ENTITY_COUNT, field_value, entity_ids,
|
||||
COLLECTION_DIMENSION);
|
||||
}
|
||||
entity_ids.clear();
|
||||
milvus::Status status = conn_->Insert(collection_name, "", field_value, entity_ids);
|
||||
search_id_array_.emplace_back(entity_ids[10]);
|
||||
std::cout << "InsertEntities function call status: " << status.message() << std::endl;
|
||||
|
@ -335,7 +335,7 @@ ClientTest::Test() {
|
|||
InsertEntities(collection_name);
|
||||
Flush(collection_name);
|
||||
CountEntities(collection_name);
|
||||
CreateIndex(collection_name, 1024);
|
||||
CreateIndex(collection_name, NLIST);
|
||||
GetCollectionInfo(collection_name);
|
||||
// GetCollectionStats(collection_name);
|
||||
//
|
||||
|
@ -355,5 +355,5 @@ ClientTest::Test() {
|
|||
// entities
|
||||
//
|
||||
// DropIndex(collection_name, "field_vec", "index_3");
|
||||
// DropCollection(collection_name);
|
||||
DropCollection(collection_name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue