mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-06 02:42:53 +08:00
Change input format for attributes (#1990)
* Change input of attributes Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Fix unittest for new attrs format Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Fix float type for new format Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Use new HEntity Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Add sdk_hybrid Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Add metric_type assign in CreateHybridCollection Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Fix for clang-format Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Read engine_type from extra_params Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Remove todo annotation Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Remove some comments Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Add DescribeHybridCollection request Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Remove unused code Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
parent
ba191b263a
commit
ff9697b184
@ -32,76 +32,43 @@ namespace milvus {
|
||||
namespace codec {
|
||||
|
||||
void
|
||||
DefaultAttrsFormat::read_attrs_internal(const std::string& file_path, off_t offset, size_t num,
|
||||
std::vector<uint8_t>& raw_attrs, size_t& nbytes) {
|
||||
int ra_fd = open(file_path.c_str(), O_RDONLY, 00664);
|
||||
if (ra_fd == -1) {
|
||||
DefaultAttrsFormat::read_attrs_internal(const storage::FSHandlerPtr& fs_ptr, const std::string& file_path, off_t offset,
|
||||
size_t num, std::vector<uint8_t>& raw_attrs, size_t& nbytes) {
|
||||
if (!fs_ptr->reader_ptr_->open(file_path.c_str())) {
|
||||
std::string err_msg = "Failed to open file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_CANNOT_CREATE_FILE, err_msg);
|
||||
}
|
||||
|
||||
size_t num_bytes;
|
||||
if (::read(ra_fd, &num_bytes, sizeof(size_t)) == -1) {
|
||||
std::string err_msg = "Failed to read from file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->read(&nbytes, sizeof(size_t));
|
||||
|
||||
num = std::min(num, num_bytes - offset);
|
||||
num = std::min(num, nbytes - offset);
|
||||
|
||||
offset += sizeof(size_t);
|
||||
int off = lseek(ra_fd, offset, SEEK_SET);
|
||||
if (off == -1) {
|
||||
std::string err_msg = "Failed to seek file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->seekg(offset);
|
||||
|
||||
raw_attrs.resize(num / sizeof(uint8_t));
|
||||
if (::read(ra_fd, raw_attrs.data(), num) == -1) {
|
||||
std::string err_msg = "Failed to read from file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->read(raw_attrs.data(), num);
|
||||
|
||||
nbytes = num;
|
||||
|
||||
if (::close(ra_fd) == -1) {
|
||||
std::string err_msg = "Failed to close file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->close();
|
||||
}
|
||||
|
||||
void
|
||||
DefaultAttrsFormat::read_uids_internal(const std::string& file_path, std::vector<int64_t>& uids) {
|
||||
int uid_fd = open(file_path.c_str(), O_RDONLY, 00664);
|
||||
if (uid_fd == -1) {
|
||||
DefaultAttrsFormat::read_uids_internal(const storage::FSHandlerPtr& fs_ptr, const std::string& file_path,
|
||||
std::vector<int64_t>& uids) {
|
||||
if (!fs_ptr->reader_ptr_->open(file_path.c_str())) {
|
||||
std::string err_msg = "Failed to open file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_CANNOT_CREATE_FILE, err_msg);
|
||||
}
|
||||
|
||||
size_t num_bytes;
|
||||
if (::read(uid_fd, &num_bytes, sizeof(size_t)) == -1) {
|
||||
std::string err_msg = "Failed to read from file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->read(&num_bytes, sizeof(size_t));
|
||||
|
||||
uids.resize(num_bytes / sizeof(int64_t));
|
||||
if (::read(uid_fd, uids.data(), num_bytes) == -1) {
|
||||
std::string err_msg = "Failed to read from file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->read(uids.data(), num_bytes);
|
||||
|
||||
if (::close(uid_fd) == -1) {
|
||||
std::string err_msg = "Failed to close file: " + file_path + ", error: " + std::strerror(errno);
|
||||
LOG_ENGINE_ERROR_ << err_msg;
|
||||
throw Exception(SERVER_WRITE_ERROR, err_msg);
|
||||
}
|
||||
fs_ptr->reader_ptr_->read(uids.data(), num_bytes);
|
||||
}
|
||||
|
||||
void
|
||||
@ -123,7 +90,7 @@ DefaultAttrsFormat::read(const milvus::storage::FSHandlerPtr& fs_ptr, milvus::se
|
||||
for (; uid_it != it_end; ++uid_it) {
|
||||
const auto& path = uid_it->path();
|
||||
if (path.extension().string() == user_id_extension_) {
|
||||
read_uids_internal(path.string(), uids);
|
||||
read_uids_internal(fs_ptr, path.string(), uids);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -134,10 +101,9 @@ DefaultAttrsFormat::read(const milvus::storage::FSHandlerPtr& fs_ptr, milvus::se
|
||||
if (path.extension().string() == raw_attr_extension_) {
|
||||
auto file_name = path.filename().string();
|
||||
auto field_name = file_name.substr(0, file_name.size() - 3);
|
||||
// void* attr_list;
|
||||
std::vector<uint8_t> attr_list;
|
||||
size_t nbytes;
|
||||
read_attrs_internal(path.string(), 0, INT64_MAX, attr_list, nbytes);
|
||||
read_attrs_internal(fs_ptr, path.string(), 0, INT64_MAX, attr_list, nbytes);
|
||||
milvus::segment::AttrPtr attr =
|
||||
std::make_shared<milvus::segment::Attr>(attr_list, nbytes, uids, field_name);
|
||||
attrs_read->attrs.insert(std::pair(field_name, attr));
|
||||
@ -238,7 +204,7 @@ DefaultAttrsFormat::read_uids(const milvus::storage::FSHandlerPtr& fs_ptr, std::
|
||||
for (; it != it_end; ++it) {
|
||||
const auto& path = it->path();
|
||||
if (path.extension().string() == user_id_extension_) {
|
||||
read_uids_internal(path.string(), uids);
|
||||
read_uids_internal(fs_ptr, path.string(), uids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,10 +51,11 @@ class DefaultAttrsFormat : public AttrsFormat {
|
||||
|
||||
private:
|
||||
void
|
||||
read_attrs_internal(const std::string&, off_t, size_t, std::vector<uint8_t>&, size_t&);
|
||||
read_attrs_internal(const storage::FSHandlerPtr& fs_ptr, const std::string&, off_t, size_t, std::vector<uint8_t>&,
|
||||
size_t&);
|
||||
|
||||
void
|
||||
read_uids_internal(const std::string&, std::vector<int64_t>&);
|
||||
read_uids_internal(const storage::FSHandlerPtr& fs_ptr, const std::string&, std::vector<int64_t>&);
|
||||
|
||||
private:
|
||||
std::mutex mutex_;
|
||||
|
||||
@ -153,7 +153,8 @@ class DB {
|
||||
DescribeHybridCollection(meta::CollectionSchema& collection_schema, meta::hybrid::FieldsSchema& fields_schema) = 0;
|
||||
|
||||
virtual Status
|
||||
InsertEntities(const std::string& collection_id, const std::string& partition_tag, Entity& entity,
|
||||
InsertEntities(const std::string& collection_id, const std::string& partition_tag,
|
||||
const std::vector<std::string>& field_names, Entity& entity,
|
||||
std::unordered_map<std::string, meta::hybrid::DataType>& field_types) = 0;
|
||||
|
||||
virtual Status
|
||||
|
||||
@ -586,7 +586,8 @@ DBImpl::InsertVectors(const std::string& collection_id, const std::string& parti
|
||||
}
|
||||
|
||||
Status
|
||||
DBImpl::InsertEntities(const std::string& collection_id, const std::string& partition_tag, Entity& entity,
|
||||
DBImpl::InsertEntities(const std::string& collection_id, const std::string& partition_tag,
|
||||
const std::vector<std::string>& field_names, Entity& entity,
|
||||
std::unordered_map<std::string, meta::hybrid::DataType>& attr_types) {
|
||||
if (!initialized_.load(std::memory_order_acquire)) {
|
||||
return SHUTDOWN_ERROR;
|
||||
@ -621,106 +622,113 @@ DBImpl::InsertEntities(const std::string& collection_id, const std::string& part
|
||||
// record.length = entities.vector_data_[0].binary_data_.size() * sizeof(uint8_t);
|
||||
}
|
||||
|
||||
auto attr_data_it = entity.attr_data_.begin();
|
||||
for (; attr_data_it != entity.attr_data_.end(); ++attr_data_it) {
|
||||
switch (attr_types.at(attr_data_it->first)) {
|
||||
uint64_t offset = 0;
|
||||
for (auto field_name : field_names) {
|
||||
switch (attr_types.at(field_name)) {
|
||||
case meta::hybrid::DataType::INT8: {
|
||||
std::vector<int8_t> entity_data;
|
||||
entity_data.resize(entity.entity_count_);
|
||||
for (uint64_t j = 0; j < entity.entity_count_; ++j) {
|
||||
entity_data[j] = atoi(attr_data_it->second[j].c_str());
|
||||
}
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(entity.entity_count_ * sizeof(int8_t));
|
||||
memcpy(data.data(), entity_data.data(), entity.entity_count_ * sizeof(int8_t));
|
||||
record.attr_data.insert(std::make_pair(attr_data_it->first, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(attr_data_it->first, sizeof(int8_t)));
|
||||
record.attr_data_size.insert(
|
||||
std::make_pair(attr_data_it->first, entity.entity_count_ * sizeof(int8_t)));
|
||||
std::vector<int64_t> attr_value(entity.entity_count_, 0);
|
||||
memcpy(attr_value.data(), entity.attr_value_.data() + offset, entity.entity_count_ * sizeof(int64_t));
|
||||
offset += entity.entity_count_ * sizeof(int64_t);
|
||||
|
||||
std::vector<int8_t> raw_value(entity.entity_count_, 0);
|
||||
for (uint64_t i = 0; i < entity.entity_count_; ++i) {
|
||||
raw_value[i] = attr_value[i];
|
||||
}
|
||||
|
||||
memcpy(data.data(), raw_value.data(), entity.entity_count_ * sizeof(int8_t));
|
||||
record.attr_data.insert(std::make_pair(field_name, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(field_name, sizeof(int8_t)));
|
||||
record.attr_data_size.insert(std::make_pair(field_name, entity.entity_count_ * sizeof(int8_t)));
|
||||
break;
|
||||
}
|
||||
case meta::hybrid::DataType::INT16: {
|
||||
std::vector<int16_t> entity_data;
|
||||
entity_data.resize(entity.entity_count_);
|
||||
for (uint64_t j = 0; j < entity.entity_count_; ++j) {
|
||||
entity_data[j] = atoi(attr_data_it->second[j].c_str());
|
||||
}
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(entity.entity_count_ * sizeof(int16_t));
|
||||
memcpy(data.data(), entity_data.data(), entity.entity_count_ * sizeof(int16_t));
|
||||
record.attr_data.insert(std::make_pair(attr_data_it->first, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(attr_data_it->first, sizeof(int16_t)));
|
||||
record.attr_data_size.insert(
|
||||
std::make_pair(attr_data_it->first, entity.entity_count_ * sizeof(int16_t)));
|
||||
std::vector<int64_t> attr_value(entity.entity_count_, 0);
|
||||
memcpy(attr_value.data(), entity.attr_value_.data() + offset, entity.entity_count_ * sizeof(int64_t));
|
||||
offset += entity.entity_count_ * sizeof(int64_t);
|
||||
|
||||
std::vector<int16_t> raw_value(entity.entity_count_, 0);
|
||||
for (uint64_t i = 0; i < entity.entity_count_; ++i) {
|
||||
raw_value[i] = attr_value[i];
|
||||
}
|
||||
|
||||
memcpy(data.data(), raw_value.data(), entity.entity_count_ * sizeof(int16_t));
|
||||
record.attr_data.insert(std::make_pair(field_name, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(field_name, sizeof(int16_t)));
|
||||
record.attr_data_size.insert(std::make_pair(field_name, entity.entity_count_ * sizeof(int16_t)));
|
||||
break;
|
||||
}
|
||||
case meta::hybrid::DataType::INT32: {
|
||||
std::vector<int32_t> entity_data;
|
||||
entity_data.resize(entity.entity_count_);
|
||||
for (uint64_t j = 0; j < entity.entity_count_; ++j) {
|
||||
entity_data[j] = atoi(attr_data_it->second[j].c_str());
|
||||
}
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(entity.entity_count_ * sizeof(int32_t));
|
||||
memcpy(data.data(), entity_data.data(), entity.entity_count_ * sizeof(int32_t));
|
||||
record.attr_data.insert(std::make_pair(attr_data_it->first, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(attr_data_it->first, sizeof(int32_t)));
|
||||
record.attr_data_size.insert(
|
||||
std::make_pair(attr_data_it->first, entity.entity_count_ * sizeof(int32_t)));
|
||||
std::vector<int64_t> attr_value(entity.entity_count_, 0);
|
||||
memcpy(attr_value.data(), entity.attr_value_.data() + offset, entity.entity_count_ * sizeof(int64_t));
|
||||
offset += entity.entity_count_ * sizeof(int64_t);
|
||||
|
||||
std::vector<int32_t> raw_value(entity.entity_count_, 0);
|
||||
for (uint64_t i = 0; i < entity.entity_count_; ++i) {
|
||||
raw_value[i] = attr_value[i];
|
||||
}
|
||||
|
||||
memcpy(data.data(), raw_value.data(), entity.entity_count_ * sizeof(int32_t));
|
||||
record.attr_data.insert(std::make_pair(field_name, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(field_name, sizeof(int32_t)));
|
||||
record.attr_data_size.insert(std::make_pair(field_name, entity.entity_count_ * sizeof(int32_t)));
|
||||
break;
|
||||
}
|
||||
case meta::hybrid::DataType::INT64: {
|
||||
std::vector<int64_t> entity_data;
|
||||
entity_data.resize(entity.entity_count_);
|
||||
for (uint64_t j = 0; j < entity.entity_count_; ++j) {
|
||||
entity_data[j] = atoi(attr_data_it->second[j].c_str());
|
||||
}
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(entity.entity_count_ * sizeof(int64_t));
|
||||
memcpy(data.data(), entity_data.data(), entity.entity_count_ * sizeof(int64_t));
|
||||
record.attr_data.insert(std::make_pair(attr_data_it->first, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(attr_data_it->first, sizeof(int64_t)));
|
||||
record.attr_data_size.insert(
|
||||
std::make_pair(attr_data_it->first, entity.entity_count_ * sizeof(int64_t)));
|
||||
memcpy(data.data(), entity.attr_value_.data() + offset, entity.entity_count_ * sizeof(int64_t));
|
||||
record.attr_data.insert(std::make_pair(field_name, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(field_name, sizeof(int64_t)));
|
||||
record.attr_data_size.insert(std::make_pair(field_name, entity.entity_count_ * sizeof(int64_t)));
|
||||
offset += entity.entity_count_ * sizeof(int64_t);
|
||||
break;
|
||||
}
|
||||
case meta::hybrid::DataType::FLOAT: {
|
||||
std::vector<float> entity_data;
|
||||
entity_data.resize(entity.entity_count_);
|
||||
for (uint64_t j = 0; j < entity.entity_count_; ++j) {
|
||||
entity_data[j] = atof(attr_data_it->second[j].c_str());
|
||||
}
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(entity.entity_count_ * sizeof(float));
|
||||
memcpy(data.data(), entity_data.data(), entity.entity_count_ * sizeof(float));
|
||||
record.attr_data.insert(std::make_pair(attr_data_it->first, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(attr_data_it->first, sizeof(float)));
|
||||
record.attr_data_size.insert(std::make_pair(attr_data_it->first, entity.entity_count_ * sizeof(float)));
|
||||
std::vector<double> attr_value(entity.entity_count_, 0);
|
||||
memcpy(attr_value.data(), entity.attr_value_.data() + offset, entity.entity_count_ * sizeof(double));
|
||||
offset += entity.entity_count_ * sizeof(double);
|
||||
|
||||
std::vector<float> raw_value(entity.entity_count_, 0);
|
||||
for (uint64_t i = 0; i < entity.entity_count_; ++i) {
|
||||
raw_value[i] = attr_value[i];
|
||||
}
|
||||
|
||||
memcpy(data.data(), raw_value.data(), entity.entity_count_ * sizeof(float));
|
||||
record.attr_data.insert(std::make_pair(field_name, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(field_name, sizeof(float)));
|
||||
record.attr_data_size.insert(std::make_pair(field_name, entity.entity_count_ * sizeof(float)));
|
||||
break;
|
||||
}
|
||||
case meta::hybrid::DataType::DOUBLE: {
|
||||
std::vector<double> entity_data;
|
||||
entity_data.resize(entity.entity_count_);
|
||||
for (uint64_t j = 0; j < entity.entity_count_; ++j) {
|
||||
entity_data[j] = atof(attr_data_it->second[j].c_str());
|
||||
}
|
||||
std::vector<uint8_t> data;
|
||||
data.resize(entity.entity_count_ * sizeof(double));
|
||||
memcpy(data.data(), entity_data.data(), entity.entity_count_ * sizeof(double));
|
||||
record.attr_data.insert(std::make_pair(attr_data_it->first, data));
|
||||
memcpy(data.data(), entity.attr_value_.data() + offset, entity.entity_count_ * sizeof(double));
|
||||
record.attr_data.insert(std::make_pair(field_name, data));
|
||||
|
||||
record.attr_nbytes.insert(std::make_pair(attr_data_it->first, sizeof(double)));
|
||||
record.attr_data_size.insert(
|
||||
std::make_pair(attr_data_it->first, entity.entity_count_ * sizeof(double)));
|
||||
record.attr_nbytes.insert(std::make_pair(field_name, sizeof(double)));
|
||||
record.attr_data_size.insert(std::make_pair(field_name, entity.entity_count_ * sizeof(double)));
|
||||
offset += entity.entity_count_ * sizeof(double);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +144,8 @@ class DBImpl : public DB, public server::CacheConfigHandler, public server::Engi
|
||||
meta::hybrid::FieldsSchema& fields_schema) override;
|
||||
|
||||
Status
|
||||
InsertEntities(const std::string& collection_name, const std::string& partition_tag, engine::Entity& entity,
|
||||
InsertEntities(const std::string& collection_name, const std::string& partition_tag,
|
||||
const std::vector<std::string>& field_names, engine::Entity& entity,
|
||||
std::unordered_map<std::string, meta::hybrid::DataType>& field_types) override;
|
||||
|
||||
Status
|
||||
|
||||
@ -50,6 +50,7 @@ struct VectorsData {
|
||||
|
||||
struct Entity {
|
||||
uint64_t entity_count_ = 0;
|
||||
std::vector<uint8_t> attr_value_;
|
||||
std::unordered_map<std::string, std::vector<std::string>> attr_data_;
|
||||
std::unordered_map<std::string, VectorsData> vector_data_;
|
||||
IDNumbers id_array_;
|
||||
|
||||
@ -810,10 +810,17 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
|
||||
std::vector<int8_t> data;
|
||||
data.resize(size / sizeof(int8_t));
|
||||
memcpy(data.data(), attr_data_.at(field_name).data(), size);
|
||||
|
||||
std::vector<int8_t> term_value;
|
||||
auto term_size =
|
||||
general_query->leaf->term_query->field_value.size() * (sizeof(int8_t)) / sizeof(int8_t);
|
||||
term_value.resize(term_size);
|
||||
memcpy(term_value.data(), general_query->leaf->term_query->field_value.data(),
|
||||
term_size * sizeof(int8_t));
|
||||
|
||||
for (uint64_t i = 0; i < data.size(); ++i) {
|
||||
bool value_in_term = false;
|
||||
for (auto term_value : general_query->leaf->term_query->field_value) {
|
||||
int8_t query_value = atoi(term_value.c_str());
|
||||
for (auto query_value : term_value) {
|
||||
if (data[i] == query_value) {
|
||||
value_in_term = true;
|
||||
break;
|
||||
@ -831,10 +838,16 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
|
||||
std::vector<int16_t> data;
|
||||
data.resize(size / sizeof(int16_t));
|
||||
memcpy(data.data(), attr_data_.at(field_name).data(), size);
|
||||
std::vector<int16_t> term_value;
|
||||
auto term_size =
|
||||
general_query->leaf->term_query->field_value.size() * (sizeof(int8_t)) / sizeof(int16_t);
|
||||
term_value.resize(term_size);
|
||||
memcpy(term_value.data(), general_query->leaf->term_query->field_value.data(),
|
||||
term_size * sizeof(int16_t));
|
||||
|
||||
for (uint64_t i = 0; i < data.size(); ++i) {
|
||||
bool value_in_term = false;
|
||||
for (auto term_value : general_query->leaf->term_query->field_value) {
|
||||
int16_t query_value = atoi(term_value.c_str());
|
||||
for (auto query_value : term_value) {
|
||||
if (data[i] == query_value) {
|
||||
value_in_term = true;
|
||||
break;
|
||||
@ -852,10 +865,17 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
|
||||
std::vector<int32_t> data;
|
||||
data.resize(size / sizeof(int32_t));
|
||||
memcpy(data.data(), attr_data_.at(field_name).data(), size);
|
||||
|
||||
std::vector<int32_t> term_value;
|
||||
auto term_size =
|
||||
general_query->leaf->term_query->field_value.size() * (sizeof(int8_t)) / sizeof(int32_t);
|
||||
term_value.resize(term_size);
|
||||
memcpy(term_value.data(), general_query->leaf->term_query->field_value.data(),
|
||||
term_size * sizeof(int32_t));
|
||||
|
||||
for (uint64_t i = 0; i < data.size(); ++i) {
|
||||
bool value_in_term = false;
|
||||
for (auto term_value : general_query->leaf->term_query->field_value) {
|
||||
int32_t query_value = atoi(term_value.c_str());
|
||||
for (auto query_value : term_value) {
|
||||
if (data[i] == query_value) {
|
||||
value_in_term = true;
|
||||
break;
|
||||
@ -873,10 +893,17 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
|
||||
std::vector<int64_t> data;
|
||||
data.resize(size / sizeof(int64_t));
|
||||
memcpy(data.data(), attr_data_.at(field_name).data(), size);
|
||||
|
||||
std::vector<int64_t> term_value;
|
||||
auto term_size =
|
||||
general_query->leaf->term_query->field_value.size() * (sizeof(int8_t)) / sizeof(int64_t);
|
||||
term_value.resize(term_size);
|
||||
memcpy(term_value.data(), general_query->leaf->term_query->field_value.data(),
|
||||
term_size * sizeof(int64_t));
|
||||
|
||||
for (uint64_t i = 0; i < data.size(); ++i) {
|
||||
bool value_in_term = false;
|
||||
for (auto term_value : general_query->leaf->term_query->field_value) {
|
||||
int64_t query_value = atoi(term_value.c_str());
|
||||
for (auto query_value : term_value) {
|
||||
if (data[i] == query_value) {
|
||||
value_in_term = true;
|
||||
break;
|
||||
@ -894,12 +921,17 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
|
||||
std::vector<float> data;
|
||||
data.resize(size / sizeof(float));
|
||||
memcpy(data.data(), attr_data_.at(field_name).data(), size);
|
||||
|
||||
std::vector<float> term_value;
|
||||
auto term_size =
|
||||
general_query->leaf->term_query->field_value.size() * (sizeof(int8_t)) / sizeof(float);
|
||||
term_value.resize(term_size);
|
||||
memcpy(term_value.data(), general_query->leaf->term_query->field_value.data(),
|
||||
term_size * sizeof(int64_t));
|
||||
|
||||
for (uint64_t i = 0; i < data.size(); ++i) {
|
||||
bool value_in_term = false;
|
||||
for (auto term_value : general_query->leaf->term_query->field_value) {
|
||||
std::istringstream iss(term_value);
|
||||
float query_value;
|
||||
iss >> query_value;
|
||||
for (auto query_value : term_value) {
|
||||
if (data[i] == query_value) {
|
||||
value_in_term = true;
|
||||
break;
|
||||
@ -917,12 +949,17 @@ ExecutionEngineImpl::ExecBinaryQuery(milvus::query::GeneralQueryPtr general_quer
|
||||
std::vector<double> data;
|
||||
data.resize(size / sizeof(double));
|
||||
memcpy(data.data(), attr_data_.at(field_name).data(), size);
|
||||
|
||||
std::vector<double> term_value;
|
||||
auto term_size =
|
||||
general_query->leaf->term_query->field_value.size() * (sizeof(int8_t)) / sizeof(double);
|
||||
term_value.resize(term_size);
|
||||
memcpy(term_value.data(), general_query->leaf->term_query->field_value.data(),
|
||||
term_size * sizeof(double));
|
||||
|
||||
for (uint64_t i = 0; i < data.size(); ++i) {
|
||||
bool value_in_term = false;
|
||||
for (auto term_value : general_query->leaf->term_query->field_value) {
|
||||
std::istringstream iss(term_value);
|
||||
double query_value;
|
||||
iss >> query_value;
|
||||
for (auto query_value : term_value) {
|
||||
if (data[i] == query_value) {
|
||||
value_in_term = true;
|
||||
break;
|
||||
|
||||
@ -15,13 +15,12 @@
|
||||
#include <google/protobuf/wire_format.h>
|
||||
// @@protoc_insertion_point(includes)
|
||||
#include <google/protobuf/port_def.inc>
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AttrRecord_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_BooleanQuery_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CompareExpr_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_FieldParam_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FieldType_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FieldValue_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_HEntity_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_HEntity_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_HSearchParam_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValuePair_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Mapping_milvus_2eproto;
|
||||
@ -521,10 +520,9 @@ static void InitDefaultsscc_info_HEntity_milvus_2eproto() {
|
||||
::milvus::grpc::HEntity::InitAsDefaultInstance();
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_HEntity_milvus_2eproto =
|
||||
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_HEntity_milvus_2eproto}, {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_HEntity_milvus_2eproto =
|
||||
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_HEntity_milvus_2eproto}, {
|
||||
&scc_info_Status_status_2eproto.base,
|
||||
&scc_info_AttrRecord_milvus_2eproto.base,
|
||||
&scc_info_FieldValue_milvus_2eproto.base,}};
|
||||
|
||||
static void InitDefaultsscc_info_HEntityIDs_milvus_2eproto() {
|
||||
@ -1266,6 +1264,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_milvus_2eproto::offsets[] PROT
|
||||
~0u, // no _weak_field_map_
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, field_name_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, values_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, value_num_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, boost_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, extra_params_),
|
||||
~0u, // no _has_bits_
|
||||
@ -1342,6 +1341,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_milvus_2eproto::offsets[] PROT
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, entity_id_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, field_names_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, attr_records_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, row_num_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, result_values_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HQueryResult, _internal_metadata_),
|
||||
@ -1436,22 +1436,22 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB
|
||||
{ 242, -1, sizeof(::milvus::grpc::Mapping)},
|
||||
{ 251, -1, sizeof(::milvus::grpc::MappingList)},
|
||||
{ 258, -1, sizeof(::milvus::grpc::TermQuery)},
|
||||
{ 267, -1, sizeof(::milvus::grpc::CompareExpr)},
|
||||
{ 274, -1, sizeof(::milvus::grpc::RangeQuery)},
|
||||
{ 283, -1, sizeof(::milvus::grpc::VectorQuery)},
|
||||
{ 293, -1, sizeof(::milvus::grpc::BooleanQuery)},
|
||||
{ 300, -1, sizeof(::milvus::grpc::GeneralQuery)},
|
||||
{ 310, -1, sizeof(::milvus::grpc::HSearchParam)},
|
||||
{ 319, -1, sizeof(::milvus::grpc::HSearchInSegmentsParam)},
|
||||
{ 326, -1, sizeof(::milvus::grpc::AttrRecord)},
|
||||
{ 332, -1, sizeof(::milvus::grpc::HEntity)},
|
||||
{ 342, -1, sizeof(::milvus::grpc::HQueryResult)},
|
||||
{ 352, -1, sizeof(::milvus::grpc::HInsertParam)},
|
||||
{ 362, -1, sizeof(::milvus::grpc::HEntityIdentity)},
|
||||
{ 369, -1, sizeof(::milvus::grpc::HEntityIDs)},
|
||||
{ 376, -1, sizeof(::milvus::grpc::HGetEntityIDsParam)},
|
||||
{ 383, -1, sizeof(::milvus::grpc::HDeleteByIDParam)},
|
||||
{ 390, -1, sizeof(::milvus::grpc::HIndexParam)},
|
||||
{ 268, -1, sizeof(::milvus::grpc::CompareExpr)},
|
||||
{ 275, -1, sizeof(::milvus::grpc::RangeQuery)},
|
||||
{ 284, -1, sizeof(::milvus::grpc::VectorQuery)},
|
||||
{ 294, -1, sizeof(::milvus::grpc::BooleanQuery)},
|
||||
{ 301, -1, sizeof(::milvus::grpc::GeneralQuery)},
|
||||
{ 311, -1, sizeof(::milvus::grpc::HSearchParam)},
|
||||
{ 320, -1, sizeof(::milvus::grpc::HSearchInSegmentsParam)},
|
||||
{ 327, -1, sizeof(::milvus::grpc::AttrRecord)},
|
||||
{ 333, -1, sizeof(::milvus::grpc::HEntity)},
|
||||
{ 344, -1, sizeof(::milvus::grpc::HQueryResult)},
|
||||
{ 354, -1, sizeof(::milvus::grpc::HInsertParam)},
|
||||
{ 364, -1, sizeof(::milvus::grpc::HEntityIdentity)},
|
||||
{ 371, -1, sizeof(::milvus::grpc::HEntityIDs)},
|
||||
{ 378, -1, sizeof(::milvus::grpc::HGetEntityIDsParam)},
|
||||
{ 385, -1, sizeof(::milvus::grpc::HDeleteByIDParam)},
|
||||
{ 392, -1, sizeof(::milvus::grpc::HIndexParam)},
|
||||
};
|
||||
|
||||
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
|
||||
@ -1589,135 +1589,136 @@ const char descriptor_table_protodef_milvus_2eproto[] PROTOBUF_SECTION_VARIABLE(
|
||||
"\n\006fields\030\004 \003(\0132\027.milvus.grpc.FieldParam\""
|
||||
"^\n\013MappingList\022#\n\006status\030\001 \001(\0132\023.milvus."
|
||||
"grpc.Status\022*\n\014mapping_list\030\002 \003(\0132\024.milv"
|
||||
"us.grpc.Mapping\"o\n\tTermQuery\022\022\n\nfield_na"
|
||||
"me\030\001 \001(\t\022\016\n\006values\030\002 \003(\t\022\r\n\005boost\030\003 \001(\002\022"
|
||||
"/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc.KeyV"
|
||||
"aluePair\"N\n\013CompareExpr\022.\n\010operator\030\001 \001("
|
||||
"\0162\034.milvus.grpc.CompareOperator\022\017\n\007opera"
|
||||
"nd\030\002 \001(\t\"\213\001\n\nRangeQuery\022\022\n\nfield_name\030\001 "
|
||||
"\001(\t\022)\n\007operand\030\002 \003(\0132\030.milvus.grpc.Compa"
|
||||
"reExpr\022\r\n\005boost\030\003 \001(\002\022/\n\014extra_params\030\004 "
|
||||
"\003(\0132\031.milvus.grpc.KeyValuePair\"\236\001\n\013Vecto"
|
||||
"rQuery\022\022\n\nfield_name\030\001 \001(\t\022\023\n\013query_boos"
|
||||
"t\030\002 \001(\002\022\'\n\007records\030\003 \003(\0132\026.milvus.grpc.R"
|
||||
"owRecord\022\014\n\004topk\030\004 \001(\003\022/\n\014extra_params\030\005"
|
||||
" \003(\0132\031.milvus.grpc.KeyValuePair\"c\n\014Boole"
|
||||
"anQuery\022!\n\005occur\030\001 \001(\0162\022.milvus.grpc.Occ"
|
||||
"ur\0220\n\rgeneral_query\030\002 \003(\0132\031.milvus.grpc."
|
||||
"GeneralQuery\"\333\001\n\014GeneralQuery\0222\n\rboolean"
|
||||
"_query\030\001 \001(\0132\031.milvus.grpc.BooleanQueryH"
|
||||
"\000\022,\n\nterm_query\030\002 \001(\0132\026.milvus.grpc.Term"
|
||||
"QueryH\000\022.\n\013range_query\030\003 \001(\0132\027.milvus.gr"
|
||||
"pc.RangeQueryH\000\0220\n\014vector_query\030\004 \001(\0132\030."
|
||||
"milvus.grpc.VectorQueryH\000B\007\n\005query\"\247\001\n\014H"
|
||||
"SearchParam\022\027\n\017collection_name\030\001 \001(\t\022\033\n\023"
|
||||
"partition_tag_array\030\002 \003(\t\0220\n\rgeneral_que"
|
||||
"ry\030\003 \001(\0132\031.milvus.grpc.GeneralQuery\022/\n\014e"
|
||||
"xtra_params\030\004 \003(\0132\031.milvus.grpc.KeyValue"
|
||||
"Pair\"c\n\026HSearchInSegmentsParam\022\030\n\020segmen"
|
||||
"t_id_array\030\001 \003(\t\022/\n\014search_param\030\002 \001(\0132\031"
|
||||
".milvus.grpc.HSearchParam\"\033\n\nAttrRecord\022"
|
||||
"\r\n\005value\030\001 \003(\t\"\265\001\n\007HEntity\022#\n\006status\030\001 \001"
|
||||
"(\0132\023.milvus.grpc.Status\022\021\n\tentity_id\030\002 \001"
|
||||
"(\003\022\023\n\013field_names\030\003 \003(\t\022-\n\014attr_records\030"
|
||||
"\004 \003(\0132\027.milvus.grpc.AttrRecord\022.\n\rresult"
|
||||
"_values\030\005 \003(\0132\027.milvus.grpc.FieldValue\"\215"
|
||||
"\001\n\014HQueryResult\022#\n\006status\030\001 \001(\0132\023.milvus"
|
||||
".grpc.Status\022&\n\010entities\030\002 \003(\0132\024.milvus."
|
||||
"grpc.HEntity\022\017\n\007row_num\030\003 \001(\003\022\r\n\005score\030\004"
|
||||
" \003(\002\022\020\n\010distance\030\005 \003(\002\"\260\001\n\014HInsertParam\022"
|
||||
"\027\n\017collection_name\030\001 \001(\t\022\025\n\rpartition_ta"
|
||||
"g\030\002 \001(\t\022&\n\010entities\030\003 \001(\0132\024.milvus.grpc."
|
||||
"HEntity\022\027\n\017entity_id_array\030\004 \003(\003\022/\n\014extr"
|
||||
"a_params\030\005 \003(\0132\031.milvus.grpc.KeyValuePai"
|
||||
"r\"6\n\017HEntityIdentity\022\027\n\017collection_name\030"
|
||||
"\001 \001(\t\022\n\n\002id\030\002 \001(\003\"J\n\nHEntityIDs\022#\n\006statu"
|
||||
"s\030\001 \001(\0132\023.milvus.grpc.Status\022\027\n\017entity_i"
|
||||
"d_array\030\002 \003(\003\"C\n\022HGetEntityIDsParam\022\027\n\017c"
|
||||
"ollection_name\030\001 \001(\t\022\024\n\014segment_name\030\002 \001"
|
||||
"(\t\"=\n\020HDeleteByIDParam\022\027\n\017collection_nam"
|
||||
"e\030\001 \001(\t\022\020\n\010id_array\030\002 \003(\003\"\220\001\n\013HIndexPara"
|
||||
"m\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Status\022\027"
|
||||
"\n\017collection_name\030\002 \001(\t\022\022\n\nindex_type\030\003 "
|
||||
"\001(\005\022/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc."
|
||||
"KeyValuePair*\206\001\n\010DataType\022\010\n\004NULL\020\000\022\010\n\004I"
|
||||
"NT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\n"
|
||||
"\n\006STRING\020\024\022\010\n\004BOOL\020\036\022\t\n\005FLOAT\020(\022\n\n\006DOUBL"
|
||||
"E\020)\022\n\n\006VECTOR\020d\022\014\n\007UNKNOWN\020\217N*C\n\017Compare"
|
||||
"Operator\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n\002EQ\020\002\022\006\n\002GT\020"
|
||||
"\003\022\007\n\003GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022\013\n\007INVALID\020\000"
|
||||
"\022\010\n\004MUST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MUST_NOT\020\0032\212\026\n"
|
||||
"\rMilvusService\022H\n\020CreateCollection\022\035.mil"
|
||||
"vus.grpc.CollectionSchema\032\023.milvus.grpc."
|
||||
"Status\"\000\022F\n\rHasCollection\022\033.milvus.grpc."
|
||||
"CollectionName\032\026.milvus.grpc.BoolReply\"\000"
|
||||
"\022R\n\022DescribeCollection\022\033.milvus.grpc.Col"
|
||||
"lectionName\032\035.milvus.grpc.CollectionSche"
|
||||
"ma\"\000\022Q\n\017CountCollection\022\033.milvus.grpc.Co"
|
||||
"llectionName\032\037.milvus.grpc.CollectionRow"
|
||||
"Count\"\000\022J\n\017ShowCollections\022\024.milvus.grpc"
|
||||
".Command\032\037.milvus.grpc.CollectionNameLis"
|
||||
"t\"\000\022P\n\022ShowCollectionInfo\022\033.milvus.grpc."
|
||||
"CollectionName\032\033.milvus.grpc.CollectionI"
|
||||
"nfo\"\000\022D\n\016DropCollection\022\033.milvus.grpc.Co"
|
||||
"llectionName\032\023.milvus.grpc.Status\"\000\022=\n\013C"
|
||||
"reateIndex\022\027.milvus.grpc.IndexParam\032\023.mi"
|
||||
"lvus.grpc.Status\"\000\022G\n\rDescribeIndex\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\027.milvus.grpc.I"
|
||||
"ndexParam\"\000\022\?\n\tDropIndex\022\033.milvus.grpc.C"
|
||||
"ollectionName\032\023.milvus.grpc.Status\"\000\022E\n\017"
|
||||
"CreatePartition\022\033.milvus.grpc.PartitionP"
|
||||
"aram\032\023.milvus.grpc.Status\"\000\022K\n\016ShowParti"
|
||||
"tions\022\033.milvus.grpc.CollectionName\032\032.mil"
|
||||
"vus.grpc.PartitionList\"\000\022C\n\rDropPartitio"
|
||||
"n\022\033.milvus.grpc.PartitionParam\032\023.milvus."
|
||||
"grpc.Status\"\000\022<\n\006Insert\022\030.milvus.grpc.In"
|
||||
"sertParam\032\026.milvus.grpc.VectorIds\"\000\022G\n\rG"
|
||||
"etVectorByID\022\033.milvus.grpc.VectorIdentit"
|
||||
"y\032\027.milvus.grpc.VectorData\"\000\022H\n\014GetVecto"
|
||||
"rIDs\022\036.milvus.grpc.GetVectorIDsParam\032\026.m"
|
||||
"ilvus.grpc.VectorIds\"\000\022B\n\006Search\022\030.milvu"
|
||||
"s.grpc.SearchParam\032\034.milvus.grpc.TopKQue"
|
||||
"ryResult\"\000\022J\n\nSearchByID\022\034.milvus.grpc.S"
|
||||
"earchByIDParam\032\034.milvus.grpc.TopKQueryRe"
|
||||
"sult\"\000\022P\n\rSearchInFiles\022\037.milvus.grpc.Se"
|
||||
"archInFilesParam\032\034.milvus.grpc.TopKQuery"
|
||||
"Result\"\000\0227\n\003Cmd\022\024.milvus.grpc.Command\032\030."
|
||||
"milvus.grpc.StringReply\"\000\022A\n\nDeleteByID\022"
|
||||
"\034.milvus.grpc.DeleteByIDParam\032\023.milvus.g"
|
||||
"rpc.Status\"\000\022G\n\021PreloadCollection\022\033.milv"
|
||||
"us.grpc.CollectionName\032\023.milvus.grpc.Sta"
|
||||
"tus\"\000\0227\n\005Flush\022\027.milvus.grpc.FlushParam\032"
|
||||
"\023.milvus.grpc.Status\"\000\022=\n\007Compact\022\033.milv"
|
||||
"us.grpc.CollectionName\032\023.milvus.grpc.Sta"
|
||||
"tus\"\000\022E\n\026CreateHybridCollection\022\024.milvus"
|
||||
".grpc.Mapping\032\023.milvus.grpc.Status\"\000\022L\n\023"
|
||||
"HasHybridCollection\022\033.milvus.grpc.Collec"
|
||||
"tionName\032\026.milvus.grpc.BoolReply\"\000\022J\n\024Dr"
|
||||
"opHybridCollection\022\033.milvus.grpc.Collect"
|
||||
"ionName\032\023.milvus.grpc.Status\"\000\022O\n\030Descri"
|
||||
"beHybridCollection\022\033.milvus.grpc.Collect"
|
||||
"ionName\032\024.milvus.grpc.Mapping\"\000\022W\n\025Count"
|
||||
"HybridCollection\022\033.milvus.grpc.Collectio"
|
||||
"nName\032\037.milvus.grpc.CollectionRowCount\"\000"
|
||||
"\022I\n\025ShowHybridCollections\022\024.milvus.grpc."
|
||||
"Command\032\030.milvus.grpc.MappingList\"\000\022V\n\030S"
|
||||
"howHybridCollectionInfo\022\033.milvus.grpc.Co"
|
||||
"llectionName\032\033.milvus.grpc.CollectionInf"
|
||||
"o\"\000\022M\n\027PreloadHybridCollection\022\033.milvus."
|
||||
"us.grpc.Mapping\"\202\001\n\tTermQuery\022\022\n\nfield_n"
|
||||
"ame\030\001 \001(\t\022\016\n\006values\030\002 \001(\014\022\021\n\tvalue_num\030\003"
|
||||
" \001(\003\022\r\n\005boost\030\004 \001(\002\022/\n\014extra_params\030\005 \003("
|
||||
"\0132\031.milvus.grpc.KeyValuePair\"N\n\013CompareE"
|
||||
"xpr\022.\n\010operator\030\001 \001(\0162\034.milvus.grpc.Comp"
|
||||
"areOperator\022\017\n\007operand\030\002 \001(\t\"\213\001\n\nRangeQu"
|
||||
"ery\022\022\n\nfield_name\030\001 \001(\t\022)\n\007operand\030\002 \003(\013"
|
||||
"2\030.milvus.grpc.CompareExpr\022\r\n\005boost\030\003 \001("
|
||||
"\002\022/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc.Ke"
|
||||
"yValuePair\"\236\001\n\013VectorQuery\022\022\n\nfield_name"
|
||||
"\030\001 \001(\t\022\023\n\013query_boost\030\002 \001(\002\022\'\n\007records\030\003"
|
||||
" \003(\0132\026.milvus.grpc.RowRecord\022\014\n\004topk\030\004 \001"
|
||||
"(\003\022/\n\014extra_params\030\005 \003(\0132\031.milvus.grpc.K"
|
||||
"eyValuePair\"c\n\014BooleanQuery\022!\n\005occur\030\001 \001"
|
||||
"(\0162\022.milvus.grpc.Occur\0220\n\rgeneral_query\030"
|
||||
"\002 \003(\0132\031.milvus.grpc.GeneralQuery\"\333\001\n\014Gen"
|
||||
"eralQuery\0222\n\rboolean_query\030\001 \001(\0132\031.milvu"
|
||||
"s.grpc.BooleanQueryH\000\022,\n\nterm_query\030\002 \001("
|
||||
"\0132\026.milvus.grpc.TermQueryH\000\022.\n\013range_que"
|
||||
"ry\030\003 \001(\0132\027.milvus.grpc.RangeQueryH\000\0220\n\014v"
|
||||
"ector_query\030\004 \001(\0132\030.milvus.grpc.VectorQu"
|
||||
"eryH\000B\007\n\005query\"\247\001\n\014HSearchParam\022\027\n\017colle"
|
||||
"ction_name\030\001 \001(\t\022\033\n\023partition_tag_array\030"
|
||||
"\002 \003(\t\0220\n\rgeneral_query\030\003 \001(\0132\031.milvus.gr"
|
||||
"pc.GeneralQuery\022/\n\014extra_params\030\004 \003(\0132\031."
|
||||
"milvus.grpc.KeyValuePair\"c\n\026HSearchInSeg"
|
||||
"mentsParam\022\030\n\020segment_id_array\030\001 \003(\t\022/\n\014"
|
||||
"search_param\030\002 \001(\0132\031.milvus.grpc.HSearch"
|
||||
"Param\"\033\n\nAttrRecord\022\r\n\005value\030\001 \003(\t\"\255\001\n\007H"
|
||||
"Entity\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Sta"
|
||||
"tus\022\021\n\tentity_id\030\002 \001(\003\022\023\n\013field_names\030\003 "
|
||||
"\003(\t\022\024\n\014attr_records\030\004 \001(\014\022\017\n\007row_num\030\005 \001"
|
||||
"(\003\022.\n\rresult_values\030\006 \003(\0132\027.milvus.grpc."
|
||||
"FieldValue\"\215\001\n\014HQueryResult\022#\n\006status\030\001 "
|
||||
"\001(\0132\023.milvus.grpc.Status\022&\n\010entities\030\002 \003"
|
||||
"(\0132\024.milvus.grpc.HEntity\022\017\n\007row_num\030\003 \001("
|
||||
"\003\022\r\n\005score\030\004 \003(\002\022\020\n\010distance\030\005 \003(\002\"\260\001\n\014H"
|
||||
"InsertParam\022\027\n\017collection_name\030\001 \001(\t\022\025\n\r"
|
||||
"partition_tag\030\002 \001(\t\022&\n\010entities\030\003 \001(\0132\024."
|
||||
"milvus.grpc.HEntity\022\027\n\017entity_id_array\030\004"
|
||||
" \003(\003\022/\n\014extra_params\030\005 \003(\0132\031.milvus.grpc"
|
||||
".KeyValuePair\"6\n\017HEntityIdentity\022\027\n\017coll"
|
||||
"ection_name\030\001 \001(\t\022\n\n\002id\030\002 \001(\003\"J\n\nHEntity"
|
||||
"IDs\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Status"
|
||||
"\022\027\n\017entity_id_array\030\002 \003(\003\"C\n\022HGetEntityI"
|
||||
"DsParam\022\027\n\017collection_name\030\001 \001(\t\022\024\n\014segm"
|
||||
"ent_name\030\002 \001(\t\"=\n\020HDeleteByIDParam\022\027\n\017co"
|
||||
"llection_name\030\001 \001(\t\022\020\n\010id_array\030\002 \003(\003\"\220\001"
|
||||
"\n\013HIndexParam\022#\n\006status\030\001 \001(\0132\023.milvus.g"
|
||||
"rpc.Status\022\027\n\017collection_name\030\002 \001(\t\022\022\n\ni"
|
||||
"ndex_type\030\003 \001(\005\022/\n\014extra_params\030\004 \003(\0132\031."
|
||||
"milvus.grpc.KeyValuePair*\206\001\n\010DataType\022\010\n"
|
||||
"\004NULL\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022"
|
||||
"\t\n\005INT64\020\004\022\n\n\006STRING\020\024\022\010\n\004BOOL\020\036\022\t\n\005FLOA"
|
||||
"T\020(\022\n\n\006DOUBLE\020)\022\n\n\006VECTOR\020d\022\014\n\007UNKNOWN\020\217"
|
||||
"N*C\n\017CompareOperator\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n"
|
||||
"\002EQ\020\002\022\006\n\002GT\020\003\022\007\n\003GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022"
|
||||
"\013\n\007INVALID\020\000\022\010\n\004MUST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MU"
|
||||
"ST_NOT\020\0032\212\026\n\rMilvusService\022H\n\020CreateColl"
|
||||
"ection\022\035.milvus.grpc.CollectionSchema\032\023."
|
||||
"milvus.grpc.Status\"\000\022F\n\rHasCollection\022\033."
|
||||
"milvus.grpc.CollectionName\032\026.milvus.grpc"
|
||||
".BoolReply\"\000\022R\n\022DescribeCollection\022\033.mil"
|
||||
"vus.grpc.CollectionName\032\035.milvus.grpc.Co"
|
||||
"llectionSchema\"\000\022Q\n\017CountCollection\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\037.milvus.grpc.C"
|
||||
"ollectionRowCount\"\000\022J\n\017ShowCollections\022\024"
|
||||
".milvus.grpc.Command\032\037.milvus.grpc.Colle"
|
||||
"ctionNameList\"\000\022P\n\022ShowCollectionInfo\022\033."
|
||||
"milvus.grpc.CollectionName\032\033.milvus.grpc"
|
||||
".CollectionInfo\"\000\022D\n\016DropCollection\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\023.milvus.grpc.S"
|
||||
"tatus\"\000\022=\n\013CreateIndex\022\027.milvus.grpc.Ind"
|
||||
"exParam\032\023.milvus.grpc.Status\"\000\022G\n\rDescri"
|
||||
"beIndex\022\033.milvus.grpc.CollectionName\032\027.m"
|
||||
"ilvus.grpc.IndexParam\"\000\022\?\n\tDropIndex\022\033.m"
|
||||
"ilvus.grpc.CollectionName\032\023.milvus.grpc."
|
||||
"Status\"\000\022E\n\017CreatePartition\022\033.milvus.grp"
|
||||
"c.PartitionParam\032\023.milvus.grpc.Status\"\000\022"
|
||||
"K\n\016ShowPartitions\022\033.milvus.grpc.Collecti"
|
||||
"onName\032\032.milvus.grpc.PartitionList\"\000\022C\n\r"
|
||||
"DropPartition\022\033.milvus.grpc.PartitionPar"
|
||||
"am\032\023.milvus.grpc.Status\"\000\022<\n\006Insert\022\030.mi"
|
||||
"lvus.grpc.InsertParam\032\026.milvus.grpc.Vect"
|
||||
"orIds\"\000\022G\n\rGetVectorByID\022\033.milvus.grpc.V"
|
||||
"ectorIdentity\032\027.milvus.grpc.VectorData\"\000"
|
||||
"\022H\n\014GetVectorIDs\022\036.milvus.grpc.GetVector"
|
||||
"IDsParam\032\026.milvus.grpc.VectorIds\"\000\022B\n\006Se"
|
||||
"arch\022\030.milvus.grpc.SearchParam\032\034.milvus."
|
||||
"grpc.TopKQueryResult\"\000\022J\n\nSearchByID\022\034.m"
|
||||
"ilvus.grpc.SearchByIDParam\032\034.milvus.grpc"
|
||||
".TopKQueryResult\"\000\022P\n\rSearchInFiles\022\037.mi"
|
||||
"lvus.grpc.SearchInFilesParam\032\034.milvus.gr"
|
||||
"pc.TopKQueryResult\"\000\0227\n\003Cmd\022\024.milvus.grp"
|
||||
"c.Command\032\030.milvus.grpc.StringReply\"\000\022A\n"
|
||||
"\nDeleteByID\022\034.milvus.grpc.DeleteByIDPara"
|
||||
"m\032\023.milvus.grpc.Status\"\000\022G\n\021PreloadColle"
|
||||
"ction\022\033.milvus.grpc.CollectionName\032\023.mil"
|
||||
"vus.grpc.Status\"\000\0227\n\005Flush\022\027.milvus.grpc"
|
||||
".FlushParam\032\023.milvus.grpc.Status\"\000\022=\n\007Co"
|
||||
"mpact\022\033.milvus.grpc.CollectionName\032\023.mil"
|
||||
"vus.grpc.Status\"\000\022E\n\026CreateHybridCollect"
|
||||
"ion\022\024.milvus.grpc.Mapping\032\023.milvus.grpc."
|
||||
"Status\"\000\022L\n\023HasHybridCollection\022\033.milvus"
|
||||
".grpc.CollectionName\032\026.milvus.grpc.BoolR"
|
||||
"eply\"\000\022J\n\024DropHybridCollection\022\033.milvus."
|
||||
"grpc.CollectionName\032\023.milvus.grpc.Status"
|
||||
"\"\000\022D\n\014InsertEntity\022\031.milvus.grpc.HInsert"
|
||||
"Param\032\027.milvus.grpc.HEntityIDs\"\000\022I\n\014Hybr"
|
||||
"idSearch\022\031.milvus.grpc.HSearchParam\032\034.mi"
|
||||
"lvus.grpc.TopKQueryResult\"\000\022]\n\026HybridSea"
|
||||
"rchInSegments\022#.milvus.grpc.HSearchInSeg"
|
||||
"mentsParam\032\034.milvus.grpc.TopKQueryResult"
|
||||
"\"\000\022E\n\rGetEntityByID\022\034.milvus.grpc.HEntit"
|
||||
"yIdentity\032\024.milvus.grpc.HEntity\"\000\022J\n\014Get"
|
||||
"EntityIDs\022\037.milvus.grpc.HGetEntityIDsPar"
|
||||
"am\032\027.milvus.grpc.HEntityIDs\"\000\022J\n\022DeleteE"
|
||||
"ntitiesByID\022\035.milvus.grpc.HDeleteByIDPar"
|
||||
"am\032\023.milvus.grpc.Status\"\000b\006proto3"
|
||||
"\"\000\022O\n\030DescribeHybridCollection\022\033.milvus."
|
||||
"grpc.CollectionName\032\024.milvus.grpc.Mappin"
|
||||
"g\"\000\022W\n\025CountHybridCollection\022\033.milvus.gr"
|
||||
"pc.CollectionName\032\037.milvus.grpc.Collecti"
|
||||
"onRowCount\"\000\022I\n\025ShowHybridCollections\022\024."
|
||||
"milvus.grpc.Command\032\030.milvus.grpc.Mappin"
|
||||
"gList\"\000\022V\n\030ShowHybridCollectionInfo\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\033.milvus.grpc.C"
|
||||
"ollectionInfo\"\000\022M\n\027PreloadHybridCollecti"
|
||||
"on\022\033.milvus.grpc.CollectionName\032\023.milvus"
|
||||
".grpc.Status\"\000\022D\n\014InsertEntity\022\031.milvus."
|
||||
"grpc.HInsertParam\032\027.milvus.grpc.HEntityI"
|
||||
"Ds\"\000\022I\n\014HybridSearch\022\031.milvus.grpc.HSear"
|
||||
"chParam\032\034.milvus.grpc.TopKQueryResult\"\000\022"
|
||||
"]\n\026HybridSearchInSegments\022#.milvus.grpc."
|
||||
"HSearchInSegmentsParam\032\034.milvus.grpc.Top"
|
||||
"KQueryResult\"\000\022E\n\rGetEntityByID\022\034.milvus"
|
||||
".grpc.HEntityIdentity\032\024.milvus.grpc.HEnt"
|
||||
"ity\"\000\022J\n\014GetEntityIDs\022\037.milvus.grpc.HGet"
|
||||
"EntityIDsParam\032\027.milvus.grpc.HEntityIDs\""
|
||||
"\000\022J\n\022DeleteEntitiesByID\022\035.milvus.grpc.HD"
|
||||
"eleteByIDParam\032\023.milvus.grpc.Status\"\000b\006p"
|
||||
"roto3"
|
||||
;
|
||||
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_milvus_2eproto_deps[1] = {
|
||||
&::descriptor_table_status_2eproto,
|
||||
@ -1776,7 +1777,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mil
|
||||
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_milvus_2eproto_once;
|
||||
static bool descriptor_table_milvus_2eproto_initialized = false;
|
||||
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_milvus_2eproto = {
|
||||
&descriptor_table_milvus_2eproto_initialized, descriptor_table_protodef_milvus_2eproto, "milvus.proto", 8393,
|
||||
&descriptor_table_milvus_2eproto_initialized, descriptor_table_protodef_milvus_2eproto, "milvus.proto", 8405,
|
||||
&descriptor_table_milvus_2eproto_once, descriptor_table_milvus_2eproto_sccs, descriptor_table_milvus_2eproto_deps, 49, 1,
|
||||
schemas, file_default_instances, TableStruct_milvus_2eproto::offsets,
|
||||
file_level_metadata_milvus_2eproto, 50, file_level_enum_descriptors_milvus_2eproto, file_level_service_descriptors_milvus_2eproto,
|
||||
@ -13996,21 +13997,29 @@ TermQuery::TermQuery()
|
||||
TermQuery::TermQuery(const TermQuery& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(),
|
||||
_internal_metadata_(nullptr),
|
||||
values_(from.values_),
|
||||
extra_params_(from.extra_params_) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (!from.field_name().empty()) {
|
||||
field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_);
|
||||
}
|
||||
boost_ = from.boost_;
|
||||
values_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (!from.values().empty()) {
|
||||
values_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.values_);
|
||||
}
|
||||
::memcpy(&value_num_, &from.value_num_,
|
||||
static_cast<size_t>(reinterpret_cast<char*>(&boost_) -
|
||||
reinterpret_cast<char*>(&value_num_)) + sizeof(boost_));
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.grpc.TermQuery)
|
||||
}
|
||||
|
||||
void TermQuery::SharedCtor() {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TermQuery_milvus_2eproto.base);
|
||||
field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
boost_ = 0;
|
||||
values_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(&value_num_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&boost_) -
|
||||
reinterpret_cast<char*>(&value_num_)) + sizeof(boost_));
|
||||
}
|
||||
|
||||
TermQuery::~TermQuery() {
|
||||
@ -14020,6 +14029,7 @@ TermQuery::~TermQuery() {
|
||||
|
||||
void TermQuery::SharedDtor() {
|
||||
field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
values_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
|
||||
void TermQuery::SetCachedSize(int size) const {
|
||||
@ -14037,10 +14047,12 @@ void TermQuery::Clear() {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
values_.Clear();
|
||||
extra_params_.Clear();
|
||||
field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
boost_ = 0;
|
||||
values_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(&value_num_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&boost_) -
|
||||
reinterpret_cast<char*>(&value_num_)) + sizeof(boost_));
|
||||
_internal_metadata_.Clear();
|
||||
}
|
||||
|
||||
@ -14059,35 +14071,37 @@ const char* TermQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated string values = 2;
|
||||
// bytes values = 2;
|
||||
case 2:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_values(), ptr, ctx, "milvus.grpc.TermQuery.values");
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_values(), ptr, ctx);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
case 3:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
|
||||
value_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// float boost = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
|
||||
boost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
|
||||
ptr += sizeof(float);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
case 5:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(add_extra_params(), ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34);
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
default: {
|
||||
@ -14135,25 +14149,33 @@ bool TermQuery::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
// bytes values = 2;
|
||||
case 2: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
|
||||
input, this->add_values()));
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->values(this->values_size() - 1).data(),
|
||||
static_cast<int>(this->values(this->values_size() - 1).length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
|
||||
"milvus.grpc.TermQuery.values"));
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_values()));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
case 3: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (29 & 0xFF)) {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &value_num_)));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
|
||||
@ -14164,9 +14186,9 @@ bool TermQuery::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
case 5: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
|
||||
input, add_extra_params()));
|
||||
} else {
|
||||
@ -14212,26 +14234,27 @@ void TermQuery::SerializeWithCachedSizes(
|
||||
1, this->field_name(), output);
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
for (int i = 0, n = this->values_size(); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->values(i).data(), static_cast<int>(this->values(i).length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"milvus.grpc.TermQuery.values");
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
|
||||
2, this->values(i), output);
|
||||
// bytes values = 2;
|
||||
if (this->values().size() > 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
|
||||
2, this->values(), output);
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
if (this->value_num() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->value_num(), output);
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
if (!(this->boost() <= 0 && this->boost() >= 0)) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->boost(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(4, this->boost(), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->extra_params_size()); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
4,
|
||||
5,
|
||||
this->extra_params(static_cast<int>(i)),
|
||||
output);
|
||||
}
|
||||
@ -14260,27 +14283,29 @@ void TermQuery::SerializeWithCachedSizes(
|
||||
1, this->field_name(), target);
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
for (int i = 0, n = this->values_size(); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->values(i).data(), static_cast<int>(this->values(i).length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"milvus.grpc.TermQuery.values");
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
WriteStringToArray(2, this->values(i), target);
|
||||
// bytes values = 2;
|
||||
if (this->values().size() > 0) {
|
||||
target =
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
|
||||
2, this->values(), target);
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
if (this->value_num() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->value_num(), target);
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
if (!(this->boost() <= 0 && this->boost() >= 0)) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->boost(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->boost(), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->extra_params_size()); i < n; i++) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
4, this->extra_params(static_cast<int>(i)), target);
|
||||
5, this->extra_params(static_cast<int>(i)), target);
|
||||
}
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -14304,15 +14329,7 @@ size_t TermQuery::ByteSizeLong() const {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// repeated string values = 2;
|
||||
total_size += 1 *
|
||||
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->values_size());
|
||||
for (int i = 0, n = this->values_size(); i < n; i++) {
|
||||
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
|
||||
this->values(i));
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
{
|
||||
unsigned int count = static_cast<unsigned int>(this->extra_params_size());
|
||||
total_size += 1UL * count;
|
||||
@ -14330,7 +14347,21 @@ size_t TermQuery::ByteSizeLong() const {
|
||||
this->field_name());
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// bytes values = 2;
|
||||
if (this->values().size() > 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
|
||||
this->values());
|
||||
}
|
||||
|
||||
// int64 value_num = 3;
|
||||
if (this->value_num() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->value_num());
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
if (!(this->boost() <= 0 && this->boost() >= 0)) {
|
||||
total_size += 1 + 4;
|
||||
}
|
||||
@ -14362,12 +14393,18 @@ void TermQuery::MergeFrom(const TermQuery& from) {
|
||||
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
values_.MergeFrom(from.values_);
|
||||
extra_params_.MergeFrom(from.extra_params_);
|
||||
if (from.field_name().size() > 0) {
|
||||
|
||||
field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_);
|
||||
}
|
||||
if (from.values().size() > 0) {
|
||||
|
||||
values_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.values_);
|
||||
}
|
||||
if (from.value_num() != 0) {
|
||||
set_value_num(from.value_num());
|
||||
}
|
||||
if (!(from.boost() <= 0 && from.boost() >= 0)) {
|
||||
set_boost(from.boost());
|
||||
}
|
||||
@ -14394,10 +14431,12 @@ bool TermQuery::IsInitialized() const {
|
||||
void TermQuery::InternalSwap(TermQuery* other) {
|
||||
using std::swap;
|
||||
_internal_metadata_.Swap(&other->_internal_metadata_);
|
||||
values_.InternalSwap(CastToBase(&other->values_));
|
||||
CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_));
|
||||
field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
GetArenaNoVirtual());
|
||||
values_.Swap(&other->values_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
GetArenaNoVirtual());
|
||||
swap(value_num_, other->value_num_);
|
||||
swap(boost_, other->boost_);
|
||||
}
|
||||
|
||||
@ -17509,23 +17548,29 @@ HEntity::HEntity(const HEntity& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(),
|
||||
_internal_metadata_(nullptr),
|
||||
field_names_(from.field_names_),
|
||||
attr_records_(from.attr_records_),
|
||||
result_values_(from.result_values_) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
attr_records_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (!from.attr_records().empty()) {
|
||||
attr_records_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.attr_records_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
entity_id_ = from.entity_id_;
|
||||
::memcpy(&entity_id_, &from.entity_id_,
|
||||
static_cast<size_t>(reinterpret_cast<char*>(&row_num_) -
|
||||
reinterpret_cast<char*>(&entity_id_)) + sizeof(row_num_));
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.grpc.HEntity)
|
||||
}
|
||||
|
||||
void HEntity::SharedCtor() {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HEntity_milvus_2eproto.base);
|
||||
attr_records_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(&status_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&entity_id_) -
|
||||
reinterpret_cast<char*>(&status_)) + sizeof(entity_id_));
|
||||
reinterpret_cast<char*>(&row_num_) -
|
||||
reinterpret_cast<char*>(&status_)) + sizeof(row_num_));
|
||||
}
|
||||
|
||||
HEntity::~HEntity() {
|
||||
@ -17534,6 +17579,7 @@ HEntity::~HEntity() {
|
||||
}
|
||||
|
||||
void HEntity::SharedDtor() {
|
||||
attr_records_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (this != internal_default_instance()) delete status_;
|
||||
}
|
||||
|
||||
@ -17553,13 +17599,15 @@ void HEntity::Clear() {
|
||||
(void) cached_has_bits;
|
||||
|
||||
field_names_.Clear();
|
||||
attr_records_.Clear();
|
||||
result_values_.Clear();
|
||||
attr_records_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (GetArenaNoVirtual() == nullptr && status_ != nullptr) {
|
||||
delete status_;
|
||||
}
|
||||
status_ = nullptr;
|
||||
entity_id_ = PROTOBUF_LONGLONG(0);
|
||||
::memset(&entity_id_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&row_num_) -
|
||||
reinterpret_cast<char*>(&entity_id_)) + sizeof(row_num_));
|
||||
_internal_metadata_.Clear();
|
||||
}
|
||||
|
||||
@ -17597,28 +17645,30 @@ const char* HEntity::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
// bytes attr_records = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(add_attr_records(), ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34);
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_attr_records(), ptr, ctx);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
case 5:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
|
||||
row_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
case 6:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(add_result_values(), ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42);
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
default: {
|
||||
@ -17691,20 +17741,33 @@ bool HEntity::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
// bytes attr_records = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
|
||||
input, add_attr_records()));
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_attr_records()));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
case 5: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &row_num_)));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
case 6: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
|
||||
input, add_result_values()));
|
||||
} else {
|
||||
@ -17761,20 +17824,22 @@ void HEntity::SerializeWithCachedSizes(
|
||||
3, this->field_names(i), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->attr_records_size()); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
4,
|
||||
this->attr_records(static_cast<int>(i)),
|
||||
output);
|
||||
// bytes attr_records = 4;
|
||||
if (this->attr_records().size() > 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
|
||||
4, this->attr_records(), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
if (this->row_num() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->row_num(), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->result_values_size()); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
5,
|
||||
6,
|
||||
this->result_values(static_cast<int>(i)),
|
||||
output);
|
||||
}
|
||||
@ -17814,20 +17879,24 @@ void HEntity::SerializeWithCachedSizes(
|
||||
WriteStringToArray(3, this->field_names(i), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->attr_records_size()); i < n; i++) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
4, this->attr_records(static_cast<int>(i)), target);
|
||||
// bytes attr_records = 4;
|
||||
if (this->attr_records().size() > 0) {
|
||||
target =
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
|
||||
4, this->attr_records(), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
if (this->row_num() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->row_num(), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->result_values_size()); i < n; i++) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
5, this->result_values(static_cast<int>(i)), target);
|
||||
6, this->result_values(static_cast<int>(i)), target);
|
||||
}
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -17859,18 +17928,7 @@ size_t HEntity::ByteSizeLong() const {
|
||||
this->field_names(i));
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
{
|
||||
unsigned int count = static_cast<unsigned int>(this->attr_records_size());
|
||||
total_size += 1UL * count;
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
total_size +=
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
|
||||
this->attr_records(static_cast<int>(i)));
|
||||
}
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
{
|
||||
unsigned int count = static_cast<unsigned int>(this->result_values_size());
|
||||
total_size += 1UL * count;
|
||||
@ -17881,6 +17939,13 @@ size_t HEntity::ByteSizeLong() const {
|
||||
}
|
||||
}
|
||||
|
||||
// bytes attr_records = 4;
|
||||
if (this->attr_records().size() > 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
|
||||
this->attr_records());
|
||||
}
|
||||
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
@ -17895,6 +17960,13 @@ size_t HEntity::ByteSizeLong() const {
|
||||
this->entity_id());
|
||||
}
|
||||
|
||||
// int64 row_num = 5;
|
||||
if (this->row_num() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->row_num());
|
||||
}
|
||||
|
||||
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
|
||||
SetCachedSize(cached_size);
|
||||
return total_size;
|
||||
@ -17923,14 +17995,20 @@ void HEntity::MergeFrom(const HEntity& from) {
|
||||
(void) cached_has_bits;
|
||||
|
||||
field_names_.MergeFrom(from.field_names_);
|
||||
attr_records_.MergeFrom(from.attr_records_);
|
||||
result_values_.MergeFrom(from.result_values_);
|
||||
if (from.attr_records().size() > 0) {
|
||||
|
||||
attr_records_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.attr_records_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
if (from.entity_id() != 0) {
|
||||
set_entity_id(from.entity_id());
|
||||
}
|
||||
if (from.row_num() != 0) {
|
||||
set_row_num(from.row_num());
|
||||
}
|
||||
}
|
||||
|
||||
void HEntity::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
|
||||
@ -17955,10 +18033,12 @@ void HEntity::InternalSwap(HEntity* other) {
|
||||
using std::swap;
|
||||
_internal_metadata_.Swap(&other->_internal_metadata_);
|
||||
field_names_.InternalSwap(CastToBase(&other->field_names_));
|
||||
CastToBase(&attr_records_)->InternalSwap(CastToBase(&other->attr_records_));
|
||||
CastToBase(&result_values_)->InternalSwap(CastToBase(&other->result_values_));
|
||||
attr_records_.Swap(&other->attr_records_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
GetArenaNoVirtual());
|
||||
swap(status_, other->status_);
|
||||
swap(entity_id_, other->entity_id_);
|
||||
swap(row_num_, other->row_num_);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata HEntity::GetMetadata() const {
|
||||
|
||||
@ -5656,29 +5656,13 @@ class TermQuery :
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kValuesFieldNumber = 2,
|
||||
kExtraParamsFieldNumber = 4,
|
||||
kExtraParamsFieldNumber = 5,
|
||||
kFieldNameFieldNumber = 1,
|
||||
kBoostFieldNumber = 3,
|
||||
kValuesFieldNumber = 2,
|
||||
kValueNumFieldNumber = 3,
|
||||
kBoostFieldNumber = 4,
|
||||
};
|
||||
// repeated string values = 2;
|
||||
int values_size() const;
|
||||
void clear_values();
|
||||
const std::string& values(int index) const;
|
||||
std::string* mutable_values(int index);
|
||||
void set_values(int index, const std::string& value);
|
||||
void set_values(int index, std::string&& value);
|
||||
void set_values(int index, const char* value);
|
||||
void set_values(int index, const char* value, size_t size);
|
||||
std::string* add_values();
|
||||
void add_values(const std::string& value);
|
||||
void add_values(std::string&& value);
|
||||
void add_values(const char* value);
|
||||
void add_values(const char* value, size_t size);
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& values() const;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_values();
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
int extra_params_size() const;
|
||||
void clear_extra_params();
|
||||
::milvus::grpc::KeyValuePair* mutable_extra_params(int index);
|
||||
@ -5700,7 +5684,23 @@ class TermQuery :
|
||||
std::string* release_field_name();
|
||||
void set_allocated_field_name(std::string* field_name);
|
||||
|
||||
// float boost = 3;
|
||||
// bytes values = 2;
|
||||
void clear_values();
|
||||
const std::string& values() const;
|
||||
void set_values(const std::string& value);
|
||||
void set_values(std::string&& value);
|
||||
void set_values(const char* value);
|
||||
void set_values(const void* value, size_t size);
|
||||
std::string* mutable_values();
|
||||
std::string* release_values();
|
||||
void set_allocated_values(std::string* values);
|
||||
|
||||
// int64 value_num = 3;
|
||||
void clear_value_num();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 value_num() const;
|
||||
void set_value_num(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// float boost = 4;
|
||||
void clear_boost();
|
||||
float boost() const;
|
||||
void set_boost(float value);
|
||||
@ -5710,9 +5710,10 @@ class TermQuery :
|
||||
class _Internal;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> values_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr values_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 value_num_;
|
||||
float boost_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
@ -7129,10 +7130,11 @@ class HEntity :
|
||||
|
||||
enum : int {
|
||||
kFieldNamesFieldNumber = 3,
|
||||
kResultValuesFieldNumber = 6,
|
||||
kAttrRecordsFieldNumber = 4,
|
||||
kResultValuesFieldNumber = 5,
|
||||
kStatusFieldNumber = 1,
|
||||
kEntityIdFieldNumber = 2,
|
||||
kRowNumFieldNumber = 5,
|
||||
};
|
||||
// repeated string field_names = 3;
|
||||
int field_names_size() const;
|
||||
@ -7151,18 +7153,7 @@ class HEntity :
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& field_names() const;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_field_names();
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
int attr_records_size() const;
|
||||
void clear_attr_records();
|
||||
::milvus::grpc::AttrRecord* mutable_attr_records(int index);
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >*
|
||||
mutable_attr_records();
|
||||
const ::milvus::grpc::AttrRecord& attr_records(int index) const;
|
||||
::milvus::grpc::AttrRecord* add_attr_records();
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >&
|
||||
attr_records() const;
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
int result_values_size() const;
|
||||
void clear_result_values();
|
||||
::milvus::grpc::FieldValue* mutable_result_values(int index);
|
||||
@ -7173,6 +7164,17 @@ class HEntity :
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldValue >&
|
||||
result_values() const;
|
||||
|
||||
// bytes attr_records = 4;
|
||||
void clear_attr_records();
|
||||
const std::string& attr_records() const;
|
||||
void set_attr_records(const std::string& value);
|
||||
void set_attr_records(std::string&& value);
|
||||
void set_attr_records(const char* value);
|
||||
void set_attr_records(const void* value, size_t size);
|
||||
std::string* mutable_attr_records();
|
||||
std::string* release_attr_records();
|
||||
void set_allocated_attr_records(std::string* attr_records);
|
||||
|
||||
// .milvus.grpc.Status status = 1;
|
||||
bool has_status() const;
|
||||
void clear_status();
|
||||
@ -7186,16 +7188,22 @@ class HEntity :
|
||||
::PROTOBUF_NAMESPACE_ID::int64 entity_id() const;
|
||||
void set_entity_id(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 row_num = 5;
|
||||
void clear_row_num();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 row_num() const;
|
||||
void set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.HEntity)
|
||||
private:
|
||||
class _Internal;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> field_names_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord > attr_records_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldValue > result_values_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr attr_records_;
|
||||
::milvus::grpc::Status* status_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 entity_id_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 row_num_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -12009,72 +12017,72 @@ inline void TermQuery::set_allocated_field_name(std::string* field_name) {
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.TermQuery.field_name)
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
inline int TermQuery::values_size() const {
|
||||
return values_.size();
|
||||
}
|
||||
// bytes values = 2;
|
||||
inline void TermQuery::clear_values() {
|
||||
values_.Clear();
|
||||
values_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline const std::string& TermQuery::values(int index) const {
|
||||
inline const std::string& TermQuery::values() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.values)
|
||||
return values_.Get(index);
|
||||
return values_.GetNoArena();
|
||||
}
|
||||
inline std::string* TermQuery::mutable_values(int index) {
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TermQuery.values)
|
||||
return values_.Mutable(index);
|
||||
}
|
||||
inline void TermQuery::set_values(int index, const std::string& value) {
|
||||
inline void TermQuery::set_values(const std::string& value) {
|
||||
|
||||
values_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.values)
|
||||
values_.Mutable(index)->assign(value);
|
||||
}
|
||||
inline void TermQuery::set_values(int index, std::string&& value) {
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.values)
|
||||
values_.Mutable(index)->assign(std::move(value));
|
||||
inline void TermQuery::set_values(std::string&& value) {
|
||||
|
||||
values_.SetNoArena(
|
||||
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
|
||||
// @@protoc_insertion_point(field_set_rvalue:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::set_values(int index, const char* value) {
|
||||
inline void TermQuery::set_values(const char* value) {
|
||||
GOOGLE_DCHECK(value != nullptr);
|
||||
values_.Mutable(index)->assign(value);
|
||||
|
||||
values_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
|
||||
// @@protoc_insertion_point(field_set_char:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::set_values(int index, const char* value, size_t size) {
|
||||
values_.Mutable(index)->assign(
|
||||
reinterpret_cast<const char*>(value), size);
|
||||
inline void TermQuery::set_values(const void* value, size_t size) {
|
||||
|
||||
values_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
::std::string(reinterpret_cast<const char*>(value), size));
|
||||
// @@protoc_insertion_point(field_set_pointer:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline std::string* TermQuery::add_values() {
|
||||
// @@protoc_insertion_point(field_add_mutable:milvus.grpc.TermQuery.values)
|
||||
return values_.Add();
|
||||
inline std::string* TermQuery::mutable_values() {
|
||||
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TermQuery.values)
|
||||
return values_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline void TermQuery::add_values(const std::string& value) {
|
||||
values_.Add()->assign(value);
|
||||
// @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.values)
|
||||
inline std::string* TermQuery::release_values() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.TermQuery.values)
|
||||
|
||||
return values_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline void TermQuery::add_values(std::string&& value) {
|
||||
values_.Add(std::move(value));
|
||||
// @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::add_values(const char* value) {
|
||||
GOOGLE_DCHECK(value != nullptr);
|
||||
values_.Add()->assign(value);
|
||||
// @@protoc_insertion_point(field_add_char:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::add_values(const char* value, size_t size) {
|
||||
values_.Add()->assign(reinterpret_cast<const char*>(value), size);
|
||||
// @@protoc_insertion_point(field_add_pointer:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
|
||||
TermQuery::values() const {
|
||||
// @@protoc_insertion_point(field_list:milvus.grpc.TermQuery.values)
|
||||
return values_;
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
|
||||
TermQuery::mutable_values() {
|
||||
// @@protoc_insertion_point(field_mutable_list:milvus.grpc.TermQuery.values)
|
||||
return &values_;
|
||||
inline void TermQuery::set_allocated_values(std::string* values) {
|
||||
if (values != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
values_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), values);
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
inline void TermQuery::clear_value_num() {
|
||||
value_num_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::int64 TermQuery::value_num() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.value_num)
|
||||
return value_num_;
|
||||
}
|
||||
inline void TermQuery::set_value_num(::PROTOBUF_NAMESPACE_ID::int64 value) {
|
||||
|
||||
value_num_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.value_num)
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
inline void TermQuery::clear_boost() {
|
||||
boost_ = 0;
|
||||
}
|
||||
@ -12088,7 +12096,7 @@ inline void TermQuery::set_boost(float value) {
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.boost)
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
inline int TermQuery::extra_params_size() const {
|
||||
return extra_params_.size();
|
||||
}
|
||||
@ -13202,37 +13210,72 @@ HEntity::mutable_field_names() {
|
||||
return &field_names_;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
inline int HEntity::attr_records_size() const {
|
||||
return attr_records_.size();
|
||||
}
|
||||
// bytes attr_records = 4;
|
||||
inline void HEntity::clear_attr_records() {
|
||||
attr_records_.Clear();
|
||||
attr_records_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline ::milvus::grpc::AttrRecord* HEntity::mutable_attr_records(int index) {
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.Mutable(index);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >*
|
||||
HEntity::mutable_attr_records() {
|
||||
// @@protoc_insertion_point(field_mutable_list:milvus.grpc.HEntity.attr_records)
|
||||
return &attr_records_;
|
||||
}
|
||||
inline const ::milvus::grpc::AttrRecord& HEntity::attr_records(int index) const {
|
||||
inline const std::string& HEntity::attr_records() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.Get(index);
|
||||
return attr_records_.GetNoArena();
|
||||
}
|
||||
inline ::milvus::grpc::AttrRecord* HEntity::add_attr_records() {
|
||||
// @@protoc_insertion_point(field_add:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.Add();
|
||||
inline void HEntity::set_attr_records(const std::string& value) {
|
||||
|
||||
attr_records_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >&
|
||||
HEntity::attr_records() const {
|
||||
// @@protoc_insertion_point(field_list:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_;
|
||||
inline void HEntity::set_attr_records(std::string&& value) {
|
||||
|
||||
attr_records_.SetNoArena(
|
||||
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
|
||||
// @@protoc_insertion_point(field_set_rvalue:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline void HEntity::set_attr_records(const char* value) {
|
||||
GOOGLE_DCHECK(value != nullptr);
|
||||
|
||||
attr_records_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
|
||||
// @@protoc_insertion_point(field_set_char:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline void HEntity::set_attr_records(const void* value, size_t size) {
|
||||
|
||||
attr_records_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
::std::string(reinterpret_cast<const char*>(value), size));
|
||||
// @@protoc_insertion_point(field_set_pointer:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline std::string* HEntity::mutable_attr_records() {
|
||||
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline std::string* HEntity::release_attr_records() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.HEntity.attr_records)
|
||||
|
||||
return attr_records_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline void HEntity::set_allocated_attr_records(std::string* attr_records) {
|
||||
if (attr_records != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
attr_records_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), attr_records);
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
inline void HEntity::clear_row_num() {
|
||||
row_num_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::int64 HEntity::row_num() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.HEntity.row_num)
|
||||
return row_num_;
|
||||
}
|
||||
inline void HEntity::set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value) {
|
||||
|
||||
row_num_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.HEntity.row_num)
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
inline int HEntity::result_values_size() const {
|
||||
return result_values_.size();
|
||||
}
|
||||
|
||||
@ -307,9 +307,10 @@ message MappingList {
|
||||
|
||||
message TermQuery {
|
||||
string field_name = 1;
|
||||
repeated string values = 2;
|
||||
float boost = 3;
|
||||
repeated KeyValuePair extra_params = 4;
|
||||
bytes values = 2;
|
||||
int64 value_num = 3;
|
||||
float boost = 4;
|
||||
repeated KeyValuePair extra_params = 5;
|
||||
}
|
||||
|
||||
enum CompareOperator {
|
||||
@ -384,8 +385,9 @@ message HEntity {
|
||||
Status status = 1;
|
||||
int64 entity_id = 2;
|
||||
repeated string field_names = 3;
|
||||
repeated AttrRecord attr_records = 4;
|
||||
repeated FieldValue result_values = 5;
|
||||
bytes attr_records = 4;
|
||||
int64 row_num = 5;
|
||||
repeated FieldValue result_values = 6;
|
||||
}
|
||||
|
||||
message HQueryResult {
|
||||
|
||||
@ -46,7 +46,7 @@ struct QueryColumn {
|
||||
|
||||
struct TermQuery {
|
||||
std::string field_name;
|
||||
std::vector<std::string> field_value;
|
||||
std::vector<uint8_t> field_value;
|
||||
float boost;
|
||||
};
|
||||
using TermQueryPtr = std::shared_ptr<TermQuery>;
|
||||
|
||||
@ -273,11 +273,11 @@ RequestHandler::HasHybridCollection(const std::shared_ptr<Context>& context, std
|
||||
|
||||
Status
|
||||
RequestHandler::InsertEntity(const std::shared_ptr<Context>& context, const std::string& collection_name,
|
||||
const std::string& partition_tag,
|
||||
std::unordered_map<std::string, std::vector<std::string>>& field_values,
|
||||
const std::string& partition_tag, uint64_t& row_num, std::vector<std::string>& field_names,
|
||||
std::vector<uint8_t>& attr_values,
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas) {
|
||||
BaseRequestPtr request_ptr =
|
||||
InsertEntityRequest::Create(context, collection_name, partition_tag, field_values, vector_datas);
|
||||
BaseRequestPtr request_ptr = InsertEntityRequest::Create(context, collection_name, partition_tag, row_num,
|
||||
field_names, attr_values, vector_datas);
|
||||
|
||||
RequestScheduler::ExecRequest(request_ptr);
|
||||
return request_ptr->status();
|
||||
|
||||
@ -129,9 +129,8 @@ class RequestHandler {
|
||||
|
||||
Status
|
||||
InsertEntity(const std::shared_ptr<Context>& context, const std::string& collection_name,
|
||||
const std::string& partition_tag,
|
||||
std::unordered_map<std::string, std::vector<std::string>>& field_values,
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas);
|
||||
const std::string& partition_tag, uint64_t& row_num, std::vector<std::string>& field_names,
|
||||
std::vector<uint8_t>& attr_values, std::unordered_map<std::string, engine::VectorsData>& vector_datas);
|
||||
|
||||
Status
|
||||
HybridSearch(const std::shared_ptr<Context>& context, context::HybridSearchContextPtr hybrid_search_context,
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include "db/Utils.h"
|
||||
#include "server/DBWrapper.h"
|
||||
#include "server/delivery/request/BaseRequest.h"
|
||||
#include "server/web_impl/Constants.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
@ -78,9 +79,22 @@ CreateHybridCollectionRequest::OnExecute() {
|
||||
fields_schema.fields_schema_[size].collection_id_ = collection_name_;
|
||||
fields_schema.fields_schema_[size].field_name_ = vector_dimensions_[0].first;
|
||||
fields_schema.fields_schema_[size].field_type_ = (int32_t)engine::meta::hybrid::DataType::VECTOR;
|
||||
auto vector_param = field_params_[size].second;
|
||||
fields_schema.fields_schema_[size].field_params_ = vector_param;
|
||||
|
||||
collection_info.dimension_ = vector_dimensions_[0].second;
|
||||
// TODO(yukun): check dimension, metric_type, and assign engine_type
|
||||
|
||||
if (vector_param != "") {
|
||||
auto json_param = nlohmann::json::parse(vector_param);
|
||||
if (json_param.contains("metric_type")) {
|
||||
int32_t metric_type = json_param["metric_type"];
|
||||
collection_info.metric_type_ = metric_type;
|
||||
}
|
||||
if (json_param.contains("engine_type")) {
|
||||
int32_t engine_type = json_param["engine_type"];
|
||||
collection_info.engine_type_ = engine_type;
|
||||
}
|
||||
}
|
||||
|
||||
// step 3: create collection
|
||||
status = DBWrapper::DB()->CreateHybridCollection(collection_info, fields_schema);
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#include "server/delivery/hybrid_request/DescribeHybridCollectionRequest.h"
|
||||
#include "db/Utils.h"
|
||||
#include "server/DBWrapper.h"
|
||||
#include "server/delivery/request/BaseRequest.h"
|
||||
#include "server/web_impl/Constants.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
|
||||
#include <fiu-local.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
DescribeHybridCollectionRequest::DescribeHybridCollectionRequest(
|
||||
const std::shared_ptr<milvus::server::Context>& context, const std::string& collection_name,
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& field_types)
|
||||
: BaseRequest(context, BaseRequest::kDescribeHybridCollection),
|
||||
collection_name_(collection_name),
|
||||
field_types_(field_types) {
|
||||
}
|
||||
|
||||
BaseRequestPtr
|
||||
DescribeHybridCollectionRequest::Create(const std::shared_ptr<milvus::server::Context>& context,
|
||||
const std::string& collection_name,
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& field_types) {
|
||||
return std::shared_ptr<BaseRequest>(new DescribeHybridCollectionRequest(context, collection_name, field_types));
|
||||
}
|
||||
|
||||
Status
|
||||
DescribeHybridCollectionRequest::OnExecute() {
|
||||
std::string hdr = "CreateCollectionRequest(collection=" + collection_name_ + ")";
|
||||
TimeRecorderAuto rc(hdr);
|
||||
|
||||
try {
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
engine::meta::hybrid::FieldsSchema fields_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
auto status = DBWrapper::DB()->DescribeHybridCollection(collection_schema, fields_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
||||
for (auto schema : fields_schema.fields_schema_) {
|
||||
field_types_.insert(std::make_pair(schema.field_name_, (engine::meta::hybrid::DataType)schema.field_type_));
|
||||
}
|
||||
} catch (std::exception& ex) {
|
||||
return Status(SERVER_UNEXPECTED_ERROR, ex.what());
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
} // namespace server
|
||||
} // namespace milvus
|
||||
@ -0,0 +1,45 @@
|
||||
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "server/delivery/request/BaseRequest.h"
|
||||
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
class DescribeHybridCollectionRequest : public BaseRequest {
|
||||
public:
|
||||
static BaseRequestPtr
|
||||
Create(const std::shared_ptr<milvus::server::Context>& context, const std::string& collection_name,
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& field_types);
|
||||
|
||||
protected:
|
||||
DescribeHybridCollectionRequest(const std::shared_ptr<milvus::server::Context>& context,
|
||||
const std::string& collection_name,
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& field_types);
|
||||
|
||||
Status
|
||||
OnExecute() override;
|
||||
|
||||
private:
|
||||
const std::string collection_name_;
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& field_types_;
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace milvus
|
||||
@ -32,30 +32,32 @@ namespace server {
|
||||
|
||||
InsertEntityRequest::InsertEntityRequest(const std::shared_ptr<milvus::server::Context>& context,
|
||||
const std::string& collection_name, const std::string& partition_tag,
|
||||
std::unordered_map<std::string, std::vector<std::string>>& field_values,
|
||||
uint64_t& row_num, std::vector<std::string>& field_names,
|
||||
std::vector<uint8_t>& attr_values,
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas)
|
||||
: BaseRequest(context, BaseRequest::kInsertEntity),
|
||||
collection_name_(collection_name),
|
||||
partition_tag_(partition_tag),
|
||||
field_values_(field_values),
|
||||
row_num_(row_num),
|
||||
field_names_(field_names),
|
||||
attr_values_(attr_values),
|
||||
vector_datas_(vector_datas) {
|
||||
}
|
||||
|
||||
BaseRequestPtr
|
||||
InsertEntityRequest::Create(const std::shared_ptr<milvus::server::Context>& context, const std::string& collection_name,
|
||||
const std::string& partition_tag,
|
||||
std::unordered_map<std::string, std::vector<std::string>>& field_values,
|
||||
const std::string& partition_tag, uint64_t& row_num, std::vector<std::string>& field_names,
|
||||
std::vector<uint8_t>& attr_values,
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas) {
|
||||
return std::shared_ptr<BaseRequest>(
|
||||
new InsertEntityRequest(context, collection_name, partition_tag, field_values, vector_datas));
|
||||
return std::shared_ptr<BaseRequest>(new InsertEntityRequest(context, collection_name, partition_tag, row_num,
|
||||
field_names, attr_values, vector_datas));
|
||||
}
|
||||
|
||||
Status
|
||||
InsertEntityRequest::OnExecute() {
|
||||
try {
|
||||
fiu_do_on("InsertEntityRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
std::string hdr = "InsertEntityRequest(table=" + collection_name_ + ", n=" + field_values_.begin()->first +
|
||||
", partition_tag=" + partition_tag_ + ")";
|
||||
std::string hdr = "InsertEntityRequest(table=" + collection_name_ + ", partition_tag=" + partition_tag_ + ")";
|
||||
TimeRecorder rc(hdr);
|
||||
|
||||
// step 1: check arguments
|
||||
@ -90,13 +92,13 @@ InsertEntityRequest::OnExecute() {
|
||||
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType> field_types;
|
||||
auto size = fields_schema.fields_schema_.size();
|
||||
for (uint64_t i = 0; i < size; ++i) {
|
||||
if (fields_schema.fields_schema_[i].field_type_ == (int32_t)engine::meta::hybrid::DataType::VECTOR) {
|
||||
continue;
|
||||
for (auto field_name : field_names_) {
|
||||
for (uint64_t i = 0; i < size; ++i) {
|
||||
if (fields_schema.fields_schema_[i].field_name_ == field_name) {
|
||||
field_types.insert(std::make_pair(
|
||||
field_name, (engine::meta::hybrid::DataType)fields_schema.fields_schema_[i].field_type_));
|
||||
}
|
||||
}
|
||||
field_types.insert(
|
||||
std::make_pair(fields_schema.fields_schema_[i].field_name_,
|
||||
(engine::meta::hybrid::DataType)fields_schema.fields_schema_[i].field_type_));
|
||||
}
|
||||
|
||||
// step 3: check table flag
|
||||
@ -128,46 +130,18 @@ InsertEntityRequest::OnExecute() {
|
||||
// step 4: some metric type doesn't support float vectors
|
||||
|
||||
// TODO(yukun): check dimension and metric_type
|
||||
// for (uint64_t i = 0; i <entities_.vector_data_.size(); ++i) {
|
||||
// if (!entities_.vector_data_[i].float_data_.empty()) { // insert float vectors
|
||||
// if (engine::utils::IsBinaryMetricType(vector_fields.vector_fields_[i].metric_type_)) {
|
||||
// return Status(SERVER_INVALID_ROWRECORD_ARRAY, "Table metric type doesn't support float
|
||||
// vectors.");
|
||||
// }
|
||||
//
|
||||
// // check prepared float data
|
||||
// fiu_do_on("InsertRequest.OnExecute.invalid_dim", table_schema.dimension_ = -1);
|
||||
// if (entities_.vector_data_[i].float_data_.size() / entities_.vector_data_[i].vector_count_ !=
|
||||
// vector_fields.vector_fields_[i].dimension_) {
|
||||
// return Status(SERVER_INVALID_VECTOR_DIMENSION,
|
||||
// "The vector dimension must be equal to the table dimension.");
|
||||
// }
|
||||
// } else if (!entities_.vector_data_[i].binary_data_.empty()) { // insert binary vectors
|
||||
// if (!engine::utils::IsBinaryMetricType(vector_fields.vector_fields_[i].metric_type_)) {
|
||||
// return Status(SERVER_INVALID_ROWRECORD_ARRAY, "Table metric type doesn't support binary
|
||||
// vectors.");
|
||||
// }
|
||||
//
|
||||
// // check prepared binary data
|
||||
// if (entities_.vector_data_[i].binary_data_.size() * 8 /
|
||||
// entities_.vector_data_[i].vector_count_ != vector_fields.vector_fields_[i].dimension_) {
|
||||
// return Status(SERVER_INVALID_VECTOR_DIMENSION,
|
||||
// "The vector dimension must be equal to the table dimension.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// step 5: insert entities
|
||||
auto vec_count = static_cast<uint64_t>(vector_datas_it->second.vector_count_);
|
||||
|
||||
engine::Entity entity;
|
||||
entity.entity_count_ = vector_datas_it->second.vector_count_;
|
||||
entity.entity_count_ = row_num_;
|
||||
|
||||
entity.attr_data_ = field_values_;
|
||||
entity.attr_value_ = attr_values_;
|
||||
entity.vector_data_.insert(std::make_pair(vector_datas_it->first, vector_datas_it->second));
|
||||
|
||||
rc.RecordSection("prepare vectors data");
|
||||
status = DBWrapper::DB()->InsertEntities(collection_name_, partition_tag_, entity, field_types);
|
||||
status = DBWrapper::DB()->InsertEntities(collection_name_, partition_tag_, field_names_, entity, field_types);
|
||||
fiu_do_on("InsertRequest.OnExecute.insert_fail", status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
|
||||
@ -25,13 +25,13 @@ class InsertEntityRequest : public BaseRequest {
|
||||
public:
|
||||
static BaseRequestPtr
|
||||
Create(const std::shared_ptr<milvus::server::Context>& context, const std::string& collection_name,
|
||||
const std::string& partition_tag, std::unordered_map<std::string, std::vector<std::string>>& field_values,
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas);
|
||||
const std::string& partition_tag, uint64_t& row_num, std::vector<std::string>& field_names,
|
||||
std::vector<uint8_t>& attr_values, std::unordered_map<std::string, engine::VectorsData>& vector_datas);
|
||||
|
||||
protected:
|
||||
InsertEntityRequest(const std::shared_ptr<milvus::server::Context>& context, const std::string& collection_name,
|
||||
const std::string& partition_tag,
|
||||
std::unordered_map<std::string, std::vector<std::string>>& field_values,
|
||||
const std::string& partition_tag, uint64_t& row_num, std::vector<std::string>& field_names,
|
||||
std::vector<uint8_t>& attr_values,
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas);
|
||||
|
||||
Status
|
||||
@ -40,7 +40,9 @@ class InsertEntityRequest : public BaseRequest {
|
||||
private:
|
||||
const std::string collection_name_;
|
||||
const std::string partition_tag_;
|
||||
std::unordered_map<std::string, std::vector<std::string>> field_values_;
|
||||
uint64_t row_num_;
|
||||
std::vector<std::string>& field_names_;
|
||||
std::vector<uint8_t>& attr_values_;
|
||||
std::unordered_map<std::string, engine::VectorsData>& vector_datas_;
|
||||
};
|
||||
|
||||
|
||||
@ -805,18 +805,19 @@ GrpcRequestHandler::InsertEntity(::grpc::ServerContext* context, const ::milvus:
|
||||
::milvus::grpc::HEntityIDs* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
std::unordered_map<std::string, std::vector<std::string>> attr_values;
|
||||
auto attr_size = request->entities().attr_records().size();
|
||||
std::vector<uint8_t> attr_values(attr_size, 0);
|
||||
std::unordered_map<std::string, engine::VectorsData> vector_datas;
|
||||
|
||||
auto attr_size = request->entities().attr_records_size();
|
||||
for (uint64_t i = 0; i < attr_size; ++i) {
|
||||
std::vector<std::string> values;
|
||||
auto record_size = request->entities().attr_records(i).value_size();
|
||||
values.resize(record_size);
|
||||
for (uint64_t j = 0; j < record_size; ++j) {
|
||||
values[j] = request->entities().attr_records(i).value(j);
|
||||
}
|
||||
attr_values.insert(std::make_pair(request->entities().field_names(i), values));
|
||||
memcpy(attr_values.data(), request->entities().attr_records().data(), attr_size);
|
||||
|
||||
uint64_t row_num = request->entities().row_num();
|
||||
|
||||
std::vector<std::string> field_names;
|
||||
auto field_size = request->entities().field_names_size();
|
||||
field_names.resize(field_size - 1);
|
||||
for (uint64_t i = 0; i < field_size - 1; ++i) {
|
||||
field_names[i] = request->entities().field_names(i);
|
||||
}
|
||||
|
||||
auto vector_size = request->entities().result_values_size();
|
||||
@ -824,13 +825,13 @@ GrpcRequestHandler::InsertEntity(::grpc::ServerContext* context, const ::milvus:
|
||||
engine::VectorsData vectors;
|
||||
CopyRowRecords(request->entities().result_values(i).vector_value().value(), request->entity_id_array(),
|
||||
vectors);
|
||||
vector_datas.insert(std::make_pair(request->entities().field_names(attr_size + i), vectors));
|
||||
vector_datas.insert(std::make_pair(request->entities().field_names(field_size - 1), vectors));
|
||||
}
|
||||
|
||||
std::string collection_name = request->collection_name();
|
||||
std::string partition_tag = request->partition_tag();
|
||||
Status status =
|
||||
request_handler_.InsertEntity(GetContext(context), collection_name, partition_tag, attr_values, vector_datas);
|
||||
Status status = request_handler_.InsertEntity(GetContext(context), collection_name, partition_tag, row_num,
|
||||
field_names, attr_values, vector_datas);
|
||||
|
||||
response->mutable_entity_id_array()->Resize(static_cast<int>(vector_datas.begin()->second.id_array_.size()), 0);
|
||||
memcpy(response->mutable_entity_id_array()->mutable_data(), vector_datas.begin()->second.id_array_.data(),
|
||||
@ -841,14 +842,12 @@ GrpcRequestHandler::InsertEntity(::grpc::ServerContext* context, const ::milvus:
|
||||
}
|
||||
|
||||
void
|
||||
DeSerialization(const ::milvus::grpc::GeneralQuery& general_query, query::BooleanQueryPtr boolean_clause) {
|
||||
DeSerialization(const ::milvus::grpc::GeneralQuery& general_query, query::BooleanQueryPtr& boolean_clause) {
|
||||
if (general_query.has_boolean_query()) {
|
||||
// boolean_clause->SetOccur((query::Occur)general_query.boolean_query().occur());
|
||||
|
||||
boolean_clause->SetOccur((query::Occur)general_query.boolean_query().occur());
|
||||
for (uint64_t i = 0; i < general_query.boolean_query().general_query_size(); ++i) {
|
||||
if (general_query.boolean_query().general_query(i).has_boolean_query()) {
|
||||
query::BooleanQueryPtr query =
|
||||
std::make_shared<query::BooleanQuery>((query::Occur)(general_query.boolean_query().occur()));
|
||||
query::BooleanQueryPtr query = std::make_shared<query::BooleanQuery>();
|
||||
DeSerialization(general_query.boolean_query().general_query(i), query);
|
||||
boolean_clause->AddBooleanQuery(query);
|
||||
} else {
|
||||
@ -858,10 +857,9 @@ DeSerialization(const ::milvus::grpc::GeneralQuery& general_query, query::Boolea
|
||||
query::TermQueryPtr term_query = std::make_shared<query::TermQuery>();
|
||||
term_query->field_name = query.term_query().field_name();
|
||||
term_query->boost = query.term_query().boost();
|
||||
term_query->field_value.resize(query.term_query().values_size());
|
||||
for (uint64_t j = 0; j < query.term_query().values_size(); ++j) {
|
||||
term_query->field_value[j] = query.term_query().values(j);
|
||||
}
|
||||
auto size = query.term_query().values().size();
|
||||
term_query->field_value.resize(size);
|
||||
memcpy(term_query->field_value.data(), query.term_query().values().data(), size);
|
||||
leaf_query->term_query = term_query;
|
||||
boolean_clause->AddLeafQuery(leaf_query);
|
||||
}
|
||||
|
||||
@ -88,19 +88,28 @@ BuildEntity(uint64_t n, uint64_t batch_index, milvus::engine::Entity& entity) {
|
||||
vectors.id_array_.push_back(n * batch_index + i);
|
||||
}
|
||||
entity.vector_data_.insert(std::make_pair("field_3", vectors));
|
||||
std::vector<std::string> value_0, value_1, value_2;
|
||||
std::vector<int32_t> value_0;
|
||||
std::vector<int64_t> value_1;
|
||||
std::vector<float> value_2;
|
||||
value_0.resize(n);
|
||||
value_1.resize(n);
|
||||
value_2.resize(n);
|
||||
for (uint64_t i = 0; i < n; ++i) {
|
||||
value_0[i] = std::to_string(i);
|
||||
value_1[i] = std::to_string(i + n);
|
||||
value_2[i] = std::to_string((i + 100) / (n + 1));
|
||||
value_0[i] = i;
|
||||
value_1[i] = i + n;
|
||||
value_2[i] = (float)((i + 100) / (n + 1));
|
||||
}
|
||||
entity.entity_count_ = n;
|
||||
entity.attr_data_.insert(std::make_pair("field_0", value_0));
|
||||
entity.attr_data_.insert(std::make_pair("field_1", value_1));
|
||||
entity.attr_data_.insert(std::make_pair("field_2", value_2));
|
||||
size_t attr_size = n * (sizeof(int32_t) + sizeof(float) + sizeof(int64_t));
|
||||
std::vector<uint8_t> attr_value(attr_size, 0);
|
||||
size_t offset = 0;
|
||||
memcpy(attr_value.data(), value_0.data(), n * sizeof(int32_t));
|
||||
offset += n * sizeof(int32_t);
|
||||
memcpy(attr_value.data() + offset, value_1.data(), n * sizeof(int64_t));
|
||||
offset += n * sizeof(int64_t);
|
||||
memcpy(attr_value.data() + offset, value_2.data(), n * sizeof(float));
|
||||
|
||||
entity.attr_value_ = attr_value;
|
||||
}
|
||||
|
||||
void
|
||||
@ -113,8 +122,12 @@ ConstructGeneralQuery(milvus::query::GeneralQueryPtr& general_query) {
|
||||
left->bin->relation = milvus::query::QueryRelation::AND;
|
||||
|
||||
auto term_query = std::make_shared<milvus::query::TermQuery>();
|
||||
std::vector<int64_t> field_value = {10, 20, 30, 40, 50};
|
||||
std::vector<uint8_t> term_value;
|
||||
term_value.resize(5 * sizeof(int64_t));
|
||||
memcpy(term_value.data(), field_value.data(), 5 * sizeof(int64_t));
|
||||
term_query->field_name = "field_0";
|
||||
term_query->field_value = {"10", "20", "30", "40", "50"};
|
||||
term_query->field_value = term_value;
|
||||
term_query->boost = 1;
|
||||
|
||||
auto range_query = std::make_shared<milvus::query::RangeQuery>();
|
||||
@ -174,22 +187,24 @@ TEST_F(DBTest, HYBRID_DB_TEST) {
|
||||
milvus::engine::Entity entity;
|
||||
BuildEntity(qb, 0, entity);
|
||||
|
||||
stat = db_->InsertEntities(TABLE_NAME, "", entity, attr_type);
|
||||
std::vector<std::string> field_names = {"field_0", "field_1", "field_2"};
|
||||
|
||||
stat = db_->InsertEntities(TABLE_NAME, "", field_names, entity, attr_type);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
stat = db_->Flush();
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// milvus::engine::CollectionIndex index;
|
||||
// index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
// index.extra_params_ = {{"nlist", 16384}};
|
||||
//
|
||||
// stat = db_->CreateIndex(TABLE_NAME, index);
|
||||
// ASSERT_TRUE(stat.ok());
|
||||
// milvus::engine::CollectionIndex index;
|
||||
// index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
// index.extra_params_ = {{"nlist", 16384}};
|
||||
//
|
||||
// stat = db_->CreateIndex(TABLE_NAME, index);
|
||||
// ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
|
||||
TEST_F(DBTest, HYBRID_SEARCH_TEST) {
|
||||
//#ifndef MILVUS_GPU_VERSION
|
||||
//#ifndef MILVUS_GPU_VERSION
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
milvus::engine::meta::hybrid::FieldsSchema fields_info;
|
||||
std::unordered_map<std::string, milvus::engine::meta::hybrid::DataType> attr_type;
|
||||
@ -208,7 +223,9 @@ TEST_F(DBTest, HYBRID_SEARCH_TEST) {
|
||||
milvus::engine::Entity entity;
|
||||
BuildEntity(qb, 0, entity);
|
||||
|
||||
stat = db_->InsertEntities(TABLE_NAME, "", entity, attr_type);
|
||||
std::vector<std::string> field_names = {"field_0", "field_1", "field_2"};
|
||||
|
||||
stat = db_->InsertEntities(TABLE_NAME, "", field_names, entity, attr_type);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
stat = db_->Flush();
|
||||
@ -226,7 +243,7 @@ TEST_F(DBTest, HYBRID_SEARCH_TEST) {
|
||||
stat = db_->HybridQuery(dummy_context_, TABLE_NAME, tags, hybrid_context, general_query, attr_type, nq, result_ids,
|
||||
result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
TEST_F(DBTest, COMPACT_TEST) {
|
||||
@ -248,7 +265,9 @@ TEST_F(DBTest, COMPACT_TEST) {
|
||||
milvus::engine::Entity entity;
|
||||
BuildEntity(vector_count, 0, entity);
|
||||
|
||||
stat = db_->InsertEntities(TABLE_NAME, "", entity, attr_type);
|
||||
std::vector<std::string> field_names = {"field_0", "field_1", "field_2"};
|
||||
|
||||
stat = db_->InsertEntities(TABLE_NAME, "", field_names, entity, attr_type);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
stat = db_->Flush();
|
||||
|
||||
@ -977,22 +977,18 @@ TEST_F(RpcHandlerTest, HYBRID_TEST) {
|
||||
milvus::grpc::HEntityIDs entity_ids;
|
||||
insert_param.set_collection_name("test_hybrid");
|
||||
|
||||
std::vector<std::string> numerica_value;
|
||||
numerica_value.resize(row_num);
|
||||
for (uint64_t i = 0; i < row_num; i++) {
|
||||
numerica_value[i] = std::to_string(i);
|
||||
}
|
||||
auto entity = insert_param.mutable_entities();
|
||||
auto field_name_0 = entity->add_field_names();
|
||||
*field_name_0 = "field_0";
|
||||
auto field_name_1 = entity->add_field_names();
|
||||
*field_name_1 = "field_1";
|
||||
|
||||
auto records_0 = entity->add_attr_records();
|
||||
for (auto value : numerica_value) {
|
||||
auto record = records_0->add_value();
|
||||
*record = value;
|
||||
entity->set_row_num(row_num);
|
||||
std::vector<int64_t> field_value(row_num, 0);
|
||||
for (uint64_t i = 0; i < row_num; i++) {
|
||||
field_value[i] = i;
|
||||
}
|
||||
entity->set_attr_records(field_value.data(), row_num * sizeof(int64_t));
|
||||
|
||||
std::vector<std::vector<float>> vector_field;
|
||||
vector_field.resize(row_num);
|
||||
@ -1012,7 +1008,6 @@ TEST_F(RpcHandlerTest, HYBRID_TEST) {
|
||||
handler->InsertEntity(&context, &insert_param, &entity_ids);
|
||||
ASSERT_EQ(entity_ids.entity_id_array_size(), row_num);
|
||||
|
||||
// TODO(yukun): Hybrid Search
|
||||
uint64_t nq = 10;
|
||||
uint64_t topk = 10;
|
||||
milvus::grpc::HSearchParam search_param;
|
||||
@ -1023,11 +1018,13 @@ TEST_F(RpcHandlerTest, HYBRID_TEST) {
|
||||
auto boolean_query_2 = general_query_1->mutable_boolean_query();
|
||||
auto term_query = boolean_query_2->add_general_query()->mutable_term_query();
|
||||
term_query->set_field_name("field_0");
|
||||
std::vector<int64_t> term_value(nq, 0);
|
||||
for (uint64_t i = 0; i < nq; ++i) {
|
||||
auto value = std::to_string(i + nq);
|
||||
auto term = term_query->add_values();
|
||||
*term = value;
|
||||
term_value[i] = i + nq;
|
||||
}
|
||||
term_query->set_value_num(nq);
|
||||
term_query->set_values(term_value.data(), nq * sizeof(int64_t));
|
||||
|
||||
auto vector_query = boolean_query_2->add_general_query()->mutable_vector_query();
|
||||
vector_query->set_field_name("field_1");
|
||||
vector_query->set_topk(topk);
|
||||
|
||||
@ -17,3 +17,4 @@ add_subdirectory(simple)
|
||||
add_subdirectory(partition)
|
||||
add_subdirectory(binary_vector)
|
||||
add_subdirectory(qps)
|
||||
add_subdirectory(hybrid)
|
||||
|
||||
27
sdk/examples/hybrid/CMakeLists.txt
Normal file
27
sdk/examples/hybrid/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
# or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
aux_source_directory(src src_files)
|
||||
|
||||
add_executable(sdk_hybrid
|
||||
main.cpp
|
||||
${src_files}
|
||||
${util_files}
|
||||
)
|
||||
|
||||
target_link_libraries(sdk_hybrid
|
||||
milvus_sdk
|
||||
pthread
|
||||
)
|
||||
|
||||
install(TARGETS sdk_hybrid DESTINATION bin)
|
||||
73
sdk/examples/hybrid/main.cpp
Normal file
73
sdk/examples/hybrid/main.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#include <getopt.h>
|
||||
#include <libgen.h>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "src/ClientTest.h"
|
||||
|
||||
void
|
||||
print_help(const std::string& app_name);
|
||||
|
||||
int
|
||||
main(int argc, char* argv[]) {
|
||||
printf("Client start...\n");
|
||||
|
||||
std::string app_name = basename(argv[0]);
|
||||
static struct option long_options[] = {{"server", optional_argument, nullptr, 's'},
|
||||
{"port", optional_argument, nullptr, 'p'},
|
||||
{"help", no_argument, nullptr, 'h'},
|
||||
{nullptr, 0, nullptr, 0}};
|
||||
|
||||
int option_index = 0;
|
||||
std::string address = "127.0.0.1", port = "19530";
|
||||
app_name = argv[0];
|
||||
|
||||
int value;
|
||||
while ((value = getopt_long(argc, argv, "s:p:h", long_options, &option_index)) != -1) {
|
||||
switch (value) {
|
||||
case 's': {
|
||||
char* address_ptr = strdup(optarg);
|
||||
address = address_ptr;
|
||||
free(address_ptr);
|
||||
break;
|
||||
}
|
||||
case 'p': {
|
||||
char* port_ptr = strdup(optarg);
|
||||
port = port_ptr;
|
||||
free(port_ptr);
|
||||
break;
|
||||
}
|
||||
case 'h':
|
||||
default:
|
||||
print_help(app_name);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
ClientTest test(address, port);
|
||||
test.TestHybrid();
|
||||
|
||||
printf("Client stop...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
print_help(const std::string& app_name) {
|
||||
printf("\n Usage: %s [OPTIONS]\n\n", app_name.c_str());
|
||||
printf(" Options:\n");
|
||||
printf(" -s --server Server address, default 127.0.0.1\n");
|
||||
printf(" -p --port Server port, default 19530\n");
|
||||
printf(" -h --help Print help information\n");
|
||||
printf("\n");
|
||||
}
|
||||
153
sdk/examples/hybrid/src/ClientTest.cpp
Normal file
153
sdk/examples/hybrid/src/ClientTest.cpp
Normal file
@ -0,0 +1,153 @@
|
||||
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#include "examples/hybrid/src/ClientTest.h"
|
||||
#include "examples/utils/TimeRecorder.h"
|
||||
#include "examples/utils/Utils.h"
|
||||
#include "include/BooleanQuery.h"
|
||||
#include "include/MilvusApi.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
|
||||
const char* COLLECTION_NAME = milvus_sdk::Utils::GenCollectionName().c_str();
|
||||
|
||||
constexpr int64_t COLLECTION_DIMENSION = 512;
|
||||
constexpr int64_t COLLECTION_INDEX_FILE_SIZE = 1024;
|
||||
constexpr milvus::MetricType COLLECTION_METRIC_TYPE = milvus::MetricType::L2;
|
||||
constexpr int64_t BATCH_ENTITY_COUNT = 100000;
|
||||
constexpr int64_t NQ = 5;
|
||||
constexpr int64_t TOP_K = 10;
|
||||
constexpr int64_t NPROBE = 32;
|
||||
constexpr int64_t SEARCH_TARGET = BATCH_ENTITY_COUNT / 2; // change this value, result is different
|
||||
constexpr int64_t ADD_ENTITY_LOOP = 5;
|
||||
constexpr milvus::IndexType INDEX_TYPE = milvus::IndexType::IVFSQ8;
|
||||
constexpr int32_t NLIST = 16384;
|
||||
constexpr uint64_t FIELD_NUM = 3;
|
||||
|
||||
} // namespace
|
||||
|
||||
ClientTest::ClientTest(const std::string& address, const std::string& port) {
|
||||
milvus::ConnectParam param = {address, port};
|
||||
conn_ = milvus::Connection::Create();
|
||||
milvus::Status stat = conn_->Connect(param);
|
||||
std::cout << "Connect function call status: " << stat.message() << std::endl;
|
||||
}
|
||||
|
||||
ClientTest::~ClientTest() {
|
||||
milvus::Status stat = milvus::Connection::Destroy(conn_);
|
||||
std::cout << "Destroy connection function call status: " << stat.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::CreateHybridCollection(const std::string& collection_name) {
|
||||
milvus::FieldPtr field_ptr1 = std::make_shared<milvus::Field>();
|
||||
milvus::FieldPtr field_ptr2 = std::make_shared<milvus::Field>();
|
||||
milvus::VectorFieldPtr vec_field_ptr = std::make_shared<milvus::VectorField>();
|
||||
field_ptr1->field_type = milvus::DataType::INT64;
|
||||
field_ptr1->field_name = "field_1";
|
||||
field_ptr2->field_type = milvus::DataType::FLOAT;
|
||||
field_ptr2->field_name = "field_2";
|
||||
vec_field_ptr->field_type = milvus::DataType::VECTOR;
|
||||
vec_field_ptr->field_name = "field_3";
|
||||
vec_field_ptr->dimension = 128;
|
||||
|
||||
std::vector<milvus::FieldPtr> numerica_fields;
|
||||
std::vector<milvus::VectorFieldPtr> vector_fields;
|
||||
numerica_fields.emplace_back(field_ptr1);
|
||||
numerica_fields.emplace_back(field_ptr2);
|
||||
vector_fields.emplace_back(vec_field_ptr);
|
||||
|
||||
milvus::HMapping mapping = {collection_name, numerica_fields, vector_fields};
|
||||
milvus::Status stat = conn_->CreateHybridCollection(mapping);
|
||||
std::cout << "CreateHybridCollection function call status: " << stat.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::Flush(const std::string& collection_name) {
|
||||
milvus_sdk::TimeRecorder rc("Flush");
|
||||
milvus::Status stat = conn_->FlushCollection(collection_name);
|
||||
std::cout << "FlushCollection function call status: " << stat.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::InsertHybridEntities(std::string& collection_name, int64_t row_num) {
|
||||
std::unordered_map<std::string, std::vector<int8_t>> numerica_value;
|
||||
std::vector<int64_t> value1;
|
||||
std::vector<double> value2;
|
||||
value1.resize(row_num);
|
||||
value2.resize(row_num);
|
||||
for (uint64_t i = 0; i < row_num; ++i) {
|
||||
value1[i] = i;
|
||||
value2[i] = i + row_num;
|
||||
}
|
||||
|
||||
std::vector<int8_t> numerica1(row_num * sizeof(int64_t), 0);
|
||||
std::vector<int8_t> numerica2(row_num * sizeof(double), 0);
|
||||
memcpy(numerica1.data(), value1.data(), row_num * sizeof(int64_t));
|
||||
memcpy(numerica2.data(), value2.data(), row_num * sizeof(double));
|
||||
|
||||
numerica_value.insert(std::make_pair("field_1", numerica1));
|
||||
numerica_value.insert(std::make_pair("field_2", numerica2));
|
||||
|
||||
std::unordered_map<std::string, std::vector<milvus::Entity>> vector_value;
|
||||
std::vector<milvus::Entity> entity_array;
|
||||
std::vector<int64_t> record_ids;
|
||||
{ // generate vectors
|
||||
milvus_sdk::Utils::BuildEntities(0, row_num, entity_array, record_ids, 128);
|
||||
}
|
||||
|
||||
vector_value.insert(std::make_pair("field_3", entity_array));
|
||||
milvus::HEntity entity = {row_num, numerica_value, vector_value};
|
||||
std::vector<uint64_t> id_array;
|
||||
milvus::Status status = conn_->InsertEntity(collection_name, "", entity, id_array);
|
||||
std::cout << "InsertHybridEntities function call status: " << status.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::HybridSearch(std::string& collection_name) {
|
||||
std::vector<std::string> partition_tags;
|
||||
milvus::TopKQueryResult topk_query_result;
|
||||
|
||||
auto leaf_queries = milvus_sdk::Utils::GenLeafQuery();
|
||||
|
||||
// must
|
||||
auto must_clause = std::make_shared<milvus::BooleanQuery>(milvus::Occur::MUST);
|
||||
must_clause->AddLeafQuery(leaf_queries[0]);
|
||||
must_clause->AddLeafQuery(leaf_queries[1]);
|
||||
must_clause->AddLeafQuery(leaf_queries[2]);
|
||||
|
||||
auto query_clause = std::make_shared<milvus::BooleanQuery>();
|
||||
query_clause->AddBooleanQuery(must_clause);
|
||||
|
||||
std::string extra_params;
|
||||
milvus::Status status =
|
||||
conn_->HybridSearch(collection_name, partition_tags, query_clause, extra_params, topk_query_result);
|
||||
for (uint64_t i = 0; i < topk_query_result.size(); ++i) {
|
||||
std::cout << topk_query_result[i].ids[0] << " --------- " << topk_query_result[i].distances[0] << std::endl;
|
||||
}
|
||||
std::cout << "HybridSearch function call status: " << status.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::TestHybrid() {
|
||||
std::string collection_name = "HYBRID_TEST";
|
||||
CreateHybridCollection(collection_name);
|
||||
InsertHybridEntities(collection_name, 1000);
|
||||
Flush(collection_name);
|
||||
sleep(2);
|
||||
HybridSearch(collection_name);
|
||||
}
|
||||
46
sdk/examples/hybrid/src/ClientTest.h
Normal file
46
sdk/examples/hybrid/src/ClientTest.h
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <MilvusApi.h>
|
||||
|
||||
class ClientTest {
|
||||
public:
|
||||
ClientTest(const std::string&, const std::string&);
|
||||
~ClientTest();
|
||||
|
||||
void
|
||||
TestHybrid();
|
||||
|
||||
private:
|
||||
void
|
||||
CreateHybridCollection(const std::string& collection_name);
|
||||
|
||||
void
|
||||
Flush(const std::string&);
|
||||
|
||||
void
|
||||
InsertHybridEntities(std::string&, int64_t);
|
||||
|
||||
void
|
||||
HybridSearch(std::string&);
|
||||
|
||||
private:
|
||||
std::shared_ptr<milvus::Connection> conn_;
|
||||
std::vector<std::pair<int64_t, milvus::Entity>> search_entity_array_;
|
||||
std::vector<int64_t> search_id_array_;
|
||||
};
|
||||
@ -56,8 +56,7 @@ main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
ClientTest test(address, port);
|
||||
// test.Test();
|
||||
test.TestHybrid();
|
||||
test.Test();
|
||||
|
||||
printf("Client stop...\n");
|
||||
return 0;
|
||||
|
||||
@ -228,86 +228,6 @@ ClientTest::DropCollection(const std::string& collection_name) {
|
||||
std::cout << "DropCollection function call status: " << stat.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::CreateHybridCollection(const std::string& collection_name) {
|
||||
milvus::FieldPtr field_ptr1 = std::make_shared<milvus::Field>();
|
||||
milvus::FieldPtr field_ptr2 = std::make_shared<milvus::Field>();
|
||||
milvus::VectorFieldPtr vec_field_ptr = std::make_shared<milvus::VectorField>();
|
||||
field_ptr1->field_type = milvus::DataType::INT64;
|
||||
field_ptr1->field_name = "field_1";
|
||||
field_ptr2->field_type = milvus::DataType::FLOAT;
|
||||
field_ptr2->field_name = "field_2";
|
||||
vec_field_ptr->field_type = milvus::DataType::VECTOR;
|
||||
vec_field_ptr->field_name = "field_3";
|
||||
vec_field_ptr->dimension = 128;
|
||||
|
||||
std::vector<milvus::FieldPtr> numerica_fields;
|
||||
std::vector<milvus::VectorFieldPtr> vector_fields;
|
||||
numerica_fields.emplace_back(field_ptr1);
|
||||
numerica_fields.emplace_back(field_ptr2);
|
||||
vector_fields.emplace_back(vec_field_ptr);
|
||||
|
||||
milvus::HMapping mapping = {collection_name, numerica_fields, vector_fields};
|
||||
milvus::Status stat = conn_->CreateHybridCollection(mapping);
|
||||
std::cout << "CreateHybridCollection function call status: " << stat.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::InsertHybridEntities(std::string& collection_name, int64_t row_num) {
|
||||
std::unordered_map<std::string, std::vector<std::string>> numerica_value;
|
||||
std::vector<std::string> value1, value2;
|
||||
value1.resize(row_num);
|
||||
value2.resize(row_num);
|
||||
for (uint64_t i = 0; i < row_num; ++i) {
|
||||
value1[i] = std::to_string(i);
|
||||
value2[i] = std::to_string(i + row_num);
|
||||
}
|
||||
numerica_value.insert(std::make_pair("field_1", value1));
|
||||
numerica_value.insert(std::make_pair("field_2", value2));
|
||||
|
||||
std::unordered_map<std::string, std::vector<milvus::Entity>> vector_value;
|
||||
std::vector<milvus::Entity> entity_array;
|
||||
std::vector<int64_t> record_ids;
|
||||
{ // generate vectors
|
||||
milvus_sdk::Utils::BuildEntities(0,
|
||||
row_num,
|
||||
entity_array,
|
||||
record_ids,
|
||||
128);
|
||||
}
|
||||
|
||||
vector_value.insert(std::make_pair("field_3", entity_array));
|
||||
milvus::HEntity entity = {numerica_value, vector_value};
|
||||
std::vector<uint64_t> id_array;
|
||||
milvus::Status status = conn_->InsertEntity(collection_name, "", entity, id_array);
|
||||
std::cout << "InsertHybridEntities function call status: " << status.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::HybridSearch(std::string& collection_name) {
|
||||
std::vector<std::string> partition_tags;
|
||||
milvus::TopKQueryResult topk_query_result;
|
||||
|
||||
auto leaf_queries = milvus_sdk::Utils::GenLeafQuery();
|
||||
|
||||
//must
|
||||
auto must_clause = std::make_shared<milvus::BooleanQuery>(milvus::Occur::MUST);
|
||||
must_clause->AddLeafQuery(leaf_queries[0]);
|
||||
must_clause->AddLeafQuery(leaf_queries[1]);
|
||||
must_clause->AddLeafQuery(leaf_queries[2]);
|
||||
|
||||
auto query_clause = std::make_shared<milvus::BooleanQuery>();
|
||||
query_clause->AddBooleanQuery(must_clause);
|
||||
|
||||
std::string extra_params;
|
||||
milvus::Status
|
||||
status = conn_->HybridSearch(collection_name, partition_tags, query_clause, extra_params, topk_query_result);
|
||||
for (uint64_t i = 0; i < topk_query_result.size(); ++i) {
|
||||
std::cout << topk_query_result[i].ids[0] << " --------- " << topk_query_result[i].distances[0] << std::endl;
|
||||
}
|
||||
std::cout << "HybridSearch function call status: " << status.message() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::Test() {
|
||||
std::string collection_name = COLLECTION_NAME;
|
||||
@ -344,13 +264,3 @@ ClientTest::Test() {
|
||||
DropIndex(collection_name);
|
||||
DropCollection(collection_name);
|
||||
}
|
||||
|
||||
void
|
||||
ClientTest::TestHybrid() {
|
||||
std::string collection_name = "HYBRID_TEST";
|
||||
CreateHybridCollection(collection_name);
|
||||
InsertHybridEntities(collection_name, 1000);
|
||||
Flush(collection_name);
|
||||
// SearchEntities(collection_name, )
|
||||
HybridSearch(collection_name);
|
||||
}
|
||||
|
||||
@ -26,9 +26,6 @@ class ClientTest {
|
||||
void
|
||||
Test();
|
||||
|
||||
void
|
||||
TestHybrid();
|
||||
|
||||
private:
|
||||
void
|
||||
ShowServerVersion();
|
||||
@ -81,17 +78,6 @@ class ClientTest {
|
||||
void
|
||||
DropCollection(const std::string&);
|
||||
|
||||
/*******************************New Interface**********************************/
|
||||
|
||||
void
|
||||
CreateHybridCollection(const std::string& collection_name);
|
||||
|
||||
void
|
||||
InsertHybridEntities(std::string&, int64_t);
|
||||
|
||||
void
|
||||
HybridSearch(std::string&);
|
||||
|
||||
private:
|
||||
std::shared_ptr<milvus::Connection> conn_;
|
||||
std::vector<std::pair<int64_t, milvus::Entity>> search_entity_array_;
|
||||
|
||||
@ -262,14 +262,17 @@ void ConstructVector(uint64_t nq, uint64_t dimension, std::vector<milvus::Entity
|
||||
std::vector<milvus::LeafQueryPtr>
|
||||
Utils::GenLeafQuery() {
|
||||
//Construct TermQuery
|
||||
std::vector<std::string> field_value;
|
||||
field_value.resize(1000);
|
||||
for (uint64_t i = 0; i < 1000; ++i) {
|
||||
field_value[i] = std::to_string(i);
|
||||
uint64_t row_num = 1000;
|
||||
std::vector<int64_t> field_value;
|
||||
field_value.resize(row_num);
|
||||
for (uint64_t i = 0; i < row_num; ++i) {
|
||||
field_value[i] = i;
|
||||
}
|
||||
std::vector<int8_t> term_value(row_num * sizeof(int64_t));
|
||||
memcpy(term_value.data(), field_value.data(), row_num * sizeof(int64_t));
|
||||
milvus::TermQueryPtr tq = std::make_shared<milvus::TermQuery>();
|
||||
tq->field_name = "field_1";
|
||||
tq->field_value = field_value;
|
||||
tq->field_value = term_value;
|
||||
|
||||
//Construct RangeQuery
|
||||
milvus::CompareExpr ce1 = {milvus::CompareOperator::LTE, "10000"}, ce2 = {milvus::CompareOperator::GTE, "1"};
|
||||
|
||||
@ -15,13 +15,12 @@
|
||||
#include <google/protobuf/wire_format.h>
|
||||
// @@protoc_insertion_point(includes)
|
||||
#include <google/protobuf/port_def.inc>
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AttrRecord_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_BooleanQuery_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CompareExpr_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_FieldParam_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FieldType_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FieldValue_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_HEntity_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_HEntity_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_HSearchParam_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValuePair_milvus_2eproto;
|
||||
extern PROTOBUF_INTERNAL_EXPORT_milvus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Mapping_milvus_2eproto;
|
||||
@ -521,10 +520,9 @@ static void InitDefaultsscc_info_HEntity_milvus_2eproto() {
|
||||
::milvus::grpc::HEntity::InitAsDefaultInstance();
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_HEntity_milvus_2eproto =
|
||||
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_HEntity_milvus_2eproto}, {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_HEntity_milvus_2eproto =
|
||||
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_HEntity_milvus_2eproto}, {
|
||||
&scc_info_Status_status_2eproto.base,
|
||||
&scc_info_AttrRecord_milvus_2eproto.base,
|
||||
&scc_info_FieldValue_milvus_2eproto.base,}};
|
||||
|
||||
static void InitDefaultsscc_info_HEntityIDs_milvus_2eproto() {
|
||||
@ -1266,6 +1264,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_milvus_2eproto::offsets[] PROT
|
||||
~0u, // no _weak_field_map_
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, field_name_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, values_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, value_num_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, boost_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, extra_params_),
|
||||
~0u, // no _has_bits_
|
||||
@ -1342,6 +1341,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_milvus_2eproto::offsets[] PROT
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, entity_id_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, field_names_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, attr_records_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, row_num_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HEntity, result_values_),
|
||||
~0u, // no _has_bits_
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::grpc::HQueryResult, _internal_metadata_),
|
||||
@ -1436,22 +1436,22 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB
|
||||
{ 242, -1, sizeof(::milvus::grpc::Mapping)},
|
||||
{ 251, -1, sizeof(::milvus::grpc::MappingList)},
|
||||
{ 258, -1, sizeof(::milvus::grpc::TermQuery)},
|
||||
{ 267, -1, sizeof(::milvus::grpc::CompareExpr)},
|
||||
{ 274, -1, sizeof(::milvus::grpc::RangeQuery)},
|
||||
{ 283, -1, sizeof(::milvus::grpc::VectorQuery)},
|
||||
{ 293, -1, sizeof(::milvus::grpc::BooleanQuery)},
|
||||
{ 300, -1, sizeof(::milvus::grpc::GeneralQuery)},
|
||||
{ 310, -1, sizeof(::milvus::grpc::HSearchParam)},
|
||||
{ 319, -1, sizeof(::milvus::grpc::HSearchInSegmentsParam)},
|
||||
{ 326, -1, sizeof(::milvus::grpc::AttrRecord)},
|
||||
{ 332, -1, sizeof(::milvus::grpc::HEntity)},
|
||||
{ 342, -1, sizeof(::milvus::grpc::HQueryResult)},
|
||||
{ 352, -1, sizeof(::milvus::grpc::HInsertParam)},
|
||||
{ 362, -1, sizeof(::milvus::grpc::HEntityIdentity)},
|
||||
{ 369, -1, sizeof(::milvus::grpc::HEntityIDs)},
|
||||
{ 376, -1, sizeof(::milvus::grpc::HGetEntityIDsParam)},
|
||||
{ 383, -1, sizeof(::milvus::grpc::HDeleteByIDParam)},
|
||||
{ 390, -1, sizeof(::milvus::grpc::HIndexParam)},
|
||||
{ 268, -1, sizeof(::milvus::grpc::CompareExpr)},
|
||||
{ 275, -1, sizeof(::milvus::grpc::RangeQuery)},
|
||||
{ 284, -1, sizeof(::milvus::grpc::VectorQuery)},
|
||||
{ 294, -1, sizeof(::milvus::grpc::BooleanQuery)},
|
||||
{ 301, -1, sizeof(::milvus::grpc::GeneralQuery)},
|
||||
{ 311, -1, sizeof(::milvus::grpc::HSearchParam)},
|
||||
{ 320, -1, sizeof(::milvus::grpc::HSearchInSegmentsParam)},
|
||||
{ 327, -1, sizeof(::milvus::grpc::AttrRecord)},
|
||||
{ 333, -1, sizeof(::milvus::grpc::HEntity)},
|
||||
{ 344, -1, sizeof(::milvus::grpc::HQueryResult)},
|
||||
{ 354, -1, sizeof(::milvus::grpc::HInsertParam)},
|
||||
{ 364, -1, sizeof(::milvus::grpc::HEntityIdentity)},
|
||||
{ 371, -1, sizeof(::milvus::grpc::HEntityIDs)},
|
||||
{ 378, -1, sizeof(::milvus::grpc::HGetEntityIDsParam)},
|
||||
{ 385, -1, sizeof(::milvus::grpc::HDeleteByIDParam)},
|
||||
{ 392, -1, sizeof(::milvus::grpc::HIndexParam)},
|
||||
};
|
||||
|
||||
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
|
||||
@ -1589,135 +1589,136 @@ const char descriptor_table_protodef_milvus_2eproto[] PROTOBUF_SECTION_VARIABLE(
|
||||
"\n\006fields\030\004 \003(\0132\027.milvus.grpc.FieldParam\""
|
||||
"^\n\013MappingList\022#\n\006status\030\001 \001(\0132\023.milvus."
|
||||
"grpc.Status\022*\n\014mapping_list\030\002 \003(\0132\024.milv"
|
||||
"us.grpc.Mapping\"o\n\tTermQuery\022\022\n\nfield_na"
|
||||
"me\030\001 \001(\t\022\016\n\006values\030\002 \003(\t\022\r\n\005boost\030\003 \001(\002\022"
|
||||
"/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc.KeyV"
|
||||
"aluePair\"N\n\013CompareExpr\022.\n\010operator\030\001 \001("
|
||||
"\0162\034.milvus.grpc.CompareOperator\022\017\n\007opera"
|
||||
"nd\030\002 \001(\t\"\213\001\n\nRangeQuery\022\022\n\nfield_name\030\001 "
|
||||
"\001(\t\022)\n\007operand\030\002 \003(\0132\030.milvus.grpc.Compa"
|
||||
"reExpr\022\r\n\005boost\030\003 \001(\002\022/\n\014extra_params\030\004 "
|
||||
"\003(\0132\031.milvus.grpc.KeyValuePair\"\236\001\n\013Vecto"
|
||||
"rQuery\022\022\n\nfield_name\030\001 \001(\t\022\023\n\013query_boos"
|
||||
"t\030\002 \001(\002\022\'\n\007records\030\003 \003(\0132\026.milvus.grpc.R"
|
||||
"owRecord\022\014\n\004topk\030\004 \001(\003\022/\n\014extra_params\030\005"
|
||||
" \003(\0132\031.milvus.grpc.KeyValuePair\"c\n\014Boole"
|
||||
"anQuery\022!\n\005occur\030\001 \001(\0162\022.milvus.grpc.Occ"
|
||||
"ur\0220\n\rgeneral_query\030\002 \003(\0132\031.milvus.grpc."
|
||||
"GeneralQuery\"\333\001\n\014GeneralQuery\0222\n\rboolean"
|
||||
"_query\030\001 \001(\0132\031.milvus.grpc.BooleanQueryH"
|
||||
"\000\022,\n\nterm_query\030\002 \001(\0132\026.milvus.grpc.Term"
|
||||
"QueryH\000\022.\n\013range_query\030\003 \001(\0132\027.milvus.gr"
|
||||
"pc.RangeQueryH\000\0220\n\014vector_query\030\004 \001(\0132\030."
|
||||
"milvus.grpc.VectorQueryH\000B\007\n\005query\"\247\001\n\014H"
|
||||
"SearchParam\022\027\n\017collection_name\030\001 \001(\t\022\033\n\023"
|
||||
"partition_tag_array\030\002 \003(\t\0220\n\rgeneral_que"
|
||||
"ry\030\003 \001(\0132\031.milvus.grpc.GeneralQuery\022/\n\014e"
|
||||
"xtra_params\030\004 \003(\0132\031.milvus.grpc.KeyValue"
|
||||
"Pair\"c\n\026HSearchInSegmentsParam\022\030\n\020segmen"
|
||||
"t_id_array\030\001 \003(\t\022/\n\014search_param\030\002 \001(\0132\031"
|
||||
".milvus.grpc.HSearchParam\"\033\n\nAttrRecord\022"
|
||||
"\r\n\005value\030\001 \003(\t\"\265\001\n\007HEntity\022#\n\006status\030\001 \001"
|
||||
"(\0132\023.milvus.grpc.Status\022\021\n\tentity_id\030\002 \001"
|
||||
"(\003\022\023\n\013field_names\030\003 \003(\t\022-\n\014attr_records\030"
|
||||
"\004 \003(\0132\027.milvus.grpc.AttrRecord\022.\n\rresult"
|
||||
"_values\030\005 \003(\0132\027.milvus.grpc.FieldValue\"\215"
|
||||
"\001\n\014HQueryResult\022#\n\006status\030\001 \001(\0132\023.milvus"
|
||||
".grpc.Status\022&\n\010entities\030\002 \003(\0132\024.milvus."
|
||||
"grpc.HEntity\022\017\n\007row_num\030\003 \001(\003\022\r\n\005score\030\004"
|
||||
" \003(\002\022\020\n\010distance\030\005 \003(\002\"\260\001\n\014HInsertParam\022"
|
||||
"\027\n\017collection_name\030\001 \001(\t\022\025\n\rpartition_ta"
|
||||
"g\030\002 \001(\t\022&\n\010entities\030\003 \001(\0132\024.milvus.grpc."
|
||||
"HEntity\022\027\n\017entity_id_array\030\004 \003(\003\022/\n\014extr"
|
||||
"a_params\030\005 \003(\0132\031.milvus.grpc.KeyValuePai"
|
||||
"r\"6\n\017HEntityIdentity\022\027\n\017collection_name\030"
|
||||
"\001 \001(\t\022\n\n\002id\030\002 \001(\003\"J\n\nHEntityIDs\022#\n\006statu"
|
||||
"s\030\001 \001(\0132\023.milvus.grpc.Status\022\027\n\017entity_i"
|
||||
"d_array\030\002 \003(\003\"C\n\022HGetEntityIDsParam\022\027\n\017c"
|
||||
"ollection_name\030\001 \001(\t\022\024\n\014segment_name\030\002 \001"
|
||||
"(\t\"=\n\020HDeleteByIDParam\022\027\n\017collection_nam"
|
||||
"e\030\001 \001(\t\022\020\n\010id_array\030\002 \003(\003\"\220\001\n\013HIndexPara"
|
||||
"m\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Status\022\027"
|
||||
"\n\017collection_name\030\002 \001(\t\022\022\n\nindex_type\030\003 "
|
||||
"\001(\005\022/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc."
|
||||
"KeyValuePair*\206\001\n\010DataType\022\010\n\004NULL\020\000\022\010\n\004I"
|
||||
"NT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT64\020\004\022\n"
|
||||
"\n\006STRING\020\024\022\010\n\004BOOL\020\036\022\t\n\005FLOAT\020(\022\n\n\006DOUBL"
|
||||
"E\020)\022\n\n\006VECTOR\020d\022\014\n\007UNKNOWN\020\217N*C\n\017Compare"
|
||||
"Operator\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n\002EQ\020\002\022\006\n\002GT\020"
|
||||
"\003\022\007\n\003GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022\013\n\007INVALID\020\000"
|
||||
"\022\010\n\004MUST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MUST_NOT\020\0032\212\026\n"
|
||||
"\rMilvusService\022H\n\020CreateCollection\022\035.mil"
|
||||
"vus.grpc.CollectionSchema\032\023.milvus.grpc."
|
||||
"Status\"\000\022F\n\rHasCollection\022\033.milvus.grpc."
|
||||
"CollectionName\032\026.milvus.grpc.BoolReply\"\000"
|
||||
"\022R\n\022DescribeCollection\022\033.milvus.grpc.Col"
|
||||
"lectionName\032\035.milvus.grpc.CollectionSche"
|
||||
"ma\"\000\022Q\n\017CountCollection\022\033.milvus.grpc.Co"
|
||||
"llectionName\032\037.milvus.grpc.CollectionRow"
|
||||
"Count\"\000\022J\n\017ShowCollections\022\024.milvus.grpc"
|
||||
".Command\032\037.milvus.grpc.CollectionNameLis"
|
||||
"t\"\000\022P\n\022ShowCollectionInfo\022\033.milvus.grpc."
|
||||
"CollectionName\032\033.milvus.grpc.CollectionI"
|
||||
"nfo\"\000\022D\n\016DropCollection\022\033.milvus.grpc.Co"
|
||||
"llectionName\032\023.milvus.grpc.Status\"\000\022=\n\013C"
|
||||
"reateIndex\022\027.milvus.grpc.IndexParam\032\023.mi"
|
||||
"lvus.grpc.Status\"\000\022G\n\rDescribeIndex\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\027.milvus.grpc.I"
|
||||
"ndexParam\"\000\022\?\n\tDropIndex\022\033.milvus.grpc.C"
|
||||
"ollectionName\032\023.milvus.grpc.Status\"\000\022E\n\017"
|
||||
"CreatePartition\022\033.milvus.grpc.PartitionP"
|
||||
"aram\032\023.milvus.grpc.Status\"\000\022K\n\016ShowParti"
|
||||
"tions\022\033.milvus.grpc.CollectionName\032\032.mil"
|
||||
"vus.grpc.PartitionList\"\000\022C\n\rDropPartitio"
|
||||
"n\022\033.milvus.grpc.PartitionParam\032\023.milvus."
|
||||
"grpc.Status\"\000\022<\n\006Insert\022\030.milvus.grpc.In"
|
||||
"sertParam\032\026.milvus.grpc.VectorIds\"\000\022G\n\rG"
|
||||
"etVectorByID\022\033.milvus.grpc.VectorIdentit"
|
||||
"y\032\027.milvus.grpc.VectorData\"\000\022H\n\014GetVecto"
|
||||
"rIDs\022\036.milvus.grpc.GetVectorIDsParam\032\026.m"
|
||||
"ilvus.grpc.VectorIds\"\000\022B\n\006Search\022\030.milvu"
|
||||
"s.grpc.SearchParam\032\034.milvus.grpc.TopKQue"
|
||||
"ryResult\"\000\022J\n\nSearchByID\022\034.milvus.grpc.S"
|
||||
"earchByIDParam\032\034.milvus.grpc.TopKQueryRe"
|
||||
"sult\"\000\022P\n\rSearchInFiles\022\037.milvus.grpc.Se"
|
||||
"archInFilesParam\032\034.milvus.grpc.TopKQuery"
|
||||
"Result\"\000\0227\n\003Cmd\022\024.milvus.grpc.Command\032\030."
|
||||
"milvus.grpc.StringReply\"\000\022A\n\nDeleteByID\022"
|
||||
"\034.milvus.grpc.DeleteByIDParam\032\023.milvus.g"
|
||||
"rpc.Status\"\000\022G\n\021PreloadCollection\022\033.milv"
|
||||
"us.grpc.CollectionName\032\023.milvus.grpc.Sta"
|
||||
"tus\"\000\0227\n\005Flush\022\027.milvus.grpc.FlushParam\032"
|
||||
"\023.milvus.grpc.Status\"\000\022=\n\007Compact\022\033.milv"
|
||||
"us.grpc.CollectionName\032\023.milvus.grpc.Sta"
|
||||
"tus\"\000\022E\n\026CreateHybridCollection\022\024.milvus"
|
||||
".grpc.Mapping\032\023.milvus.grpc.Status\"\000\022L\n\023"
|
||||
"HasHybridCollection\022\033.milvus.grpc.Collec"
|
||||
"tionName\032\026.milvus.grpc.BoolReply\"\000\022J\n\024Dr"
|
||||
"opHybridCollection\022\033.milvus.grpc.Collect"
|
||||
"ionName\032\023.milvus.grpc.Status\"\000\022O\n\030Descri"
|
||||
"beHybridCollection\022\033.milvus.grpc.Collect"
|
||||
"ionName\032\024.milvus.grpc.Mapping\"\000\022W\n\025Count"
|
||||
"HybridCollection\022\033.milvus.grpc.Collectio"
|
||||
"nName\032\037.milvus.grpc.CollectionRowCount\"\000"
|
||||
"\022I\n\025ShowHybridCollections\022\024.milvus.grpc."
|
||||
"Command\032\030.milvus.grpc.MappingList\"\000\022V\n\030S"
|
||||
"howHybridCollectionInfo\022\033.milvus.grpc.Co"
|
||||
"llectionName\032\033.milvus.grpc.CollectionInf"
|
||||
"o\"\000\022M\n\027PreloadHybridCollection\022\033.milvus."
|
||||
"us.grpc.Mapping\"\202\001\n\tTermQuery\022\022\n\nfield_n"
|
||||
"ame\030\001 \001(\t\022\016\n\006values\030\002 \001(\014\022\021\n\tvalue_num\030\003"
|
||||
" \001(\003\022\r\n\005boost\030\004 \001(\002\022/\n\014extra_params\030\005 \003("
|
||||
"\0132\031.milvus.grpc.KeyValuePair\"N\n\013CompareE"
|
||||
"xpr\022.\n\010operator\030\001 \001(\0162\034.milvus.grpc.Comp"
|
||||
"areOperator\022\017\n\007operand\030\002 \001(\t\"\213\001\n\nRangeQu"
|
||||
"ery\022\022\n\nfield_name\030\001 \001(\t\022)\n\007operand\030\002 \003(\013"
|
||||
"2\030.milvus.grpc.CompareExpr\022\r\n\005boost\030\003 \001("
|
||||
"\002\022/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc.Ke"
|
||||
"yValuePair\"\236\001\n\013VectorQuery\022\022\n\nfield_name"
|
||||
"\030\001 \001(\t\022\023\n\013query_boost\030\002 \001(\002\022\'\n\007records\030\003"
|
||||
" \003(\0132\026.milvus.grpc.RowRecord\022\014\n\004topk\030\004 \001"
|
||||
"(\003\022/\n\014extra_params\030\005 \003(\0132\031.milvus.grpc.K"
|
||||
"eyValuePair\"c\n\014BooleanQuery\022!\n\005occur\030\001 \001"
|
||||
"(\0162\022.milvus.grpc.Occur\0220\n\rgeneral_query\030"
|
||||
"\002 \003(\0132\031.milvus.grpc.GeneralQuery\"\333\001\n\014Gen"
|
||||
"eralQuery\0222\n\rboolean_query\030\001 \001(\0132\031.milvu"
|
||||
"s.grpc.BooleanQueryH\000\022,\n\nterm_query\030\002 \001("
|
||||
"\0132\026.milvus.grpc.TermQueryH\000\022.\n\013range_que"
|
||||
"ry\030\003 \001(\0132\027.milvus.grpc.RangeQueryH\000\0220\n\014v"
|
||||
"ector_query\030\004 \001(\0132\030.milvus.grpc.VectorQu"
|
||||
"eryH\000B\007\n\005query\"\247\001\n\014HSearchParam\022\027\n\017colle"
|
||||
"ction_name\030\001 \001(\t\022\033\n\023partition_tag_array\030"
|
||||
"\002 \003(\t\0220\n\rgeneral_query\030\003 \001(\0132\031.milvus.gr"
|
||||
"pc.GeneralQuery\022/\n\014extra_params\030\004 \003(\0132\031."
|
||||
"milvus.grpc.KeyValuePair\"c\n\026HSearchInSeg"
|
||||
"mentsParam\022\030\n\020segment_id_array\030\001 \003(\t\022/\n\014"
|
||||
"search_param\030\002 \001(\0132\031.milvus.grpc.HSearch"
|
||||
"Param\"\033\n\nAttrRecord\022\r\n\005value\030\001 \003(\t\"\255\001\n\007H"
|
||||
"Entity\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Sta"
|
||||
"tus\022\021\n\tentity_id\030\002 \001(\003\022\023\n\013field_names\030\003 "
|
||||
"\003(\t\022\024\n\014attr_records\030\004 \001(\014\022\017\n\007row_num\030\005 \001"
|
||||
"(\003\022.\n\rresult_values\030\006 \003(\0132\027.milvus.grpc."
|
||||
"FieldValue\"\215\001\n\014HQueryResult\022#\n\006status\030\001 "
|
||||
"\001(\0132\023.milvus.grpc.Status\022&\n\010entities\030\002 \003"
|
||||
"(\0132\024.milvus.grpc.HEntity\022\017\n\007row_num\030\003 \001("
|
||||
"\003\022\r\n\005score\030\004 \003(\002\022\020\n\010distance\030\005 \003(\002\"\260\001\n\014H"
|
||||
"InsertParam\022\027\n\017collection_name\030\001 \001(\t\022\025\n\r"
|
||||
"partition_tag\030\002 \001(\t\022&\n\010entities\030\003 \001(\0132\024."
|
||||
"milvus.grpc.HEntity\022\027\n\017entity_id_array\030\004"
|
||||
" \003(\003\022/\n\014extra_params\030\005 \003(\0132\031.milvus.grpc"
|
||||
".KeyValuePair\"6\n\017HEntityIdentity\022\027\n\017coll"
|
||||
"ection_name\030\001 \001(\t\022\n\n\002id\030\002 \001(\003\"J\n\nHEntity"
|
||||
"IDs\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Status"
|
||||
"\022\027\n\017entity_id_array\030\002 \003(\003\"C\n\022HGetEntityI"
|
||||
"DsParam\022\027\n\017collection_name\030\001 \001(\t\022\024\n\014segm"
|
||||
"ent_name\030\002 \001(\t\"=\n\020HDeleteByIDParam\022\027\n\017co"
|
||||
"llection_name\030\001 \001(\t\022\020\n\010id_array\030\002 \003(\003\"\220\001"
|
||||
"\n\013HIndexParam\022#\n\006status\030\001 \001(\0132\023.milvus.g"
|
||||
"rpc.Status\022\027\n\017collection_name\030\002 \001(\t\022\022\n\ni"
|
||||
"ndex_type\030\003 \001(\005\022/\n\014extra_params\030\004 \003(\0132\031."
|
||||
"milvus.grpc.KeyValuePair*\206\001\n\010DataType\022\010\n"
|
||||
"\004NULL\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022"
|
||||
"\t\n\005INT64\020\004\022\n\n\006STRING\020\024\022\010\n\004BOOL\020\036\022\t\n\005FLOA"
|
||||
"T\020(\022\n\n\006DOUBLE\020)\022\n\n\006VECTOR\020d\022\014\n\007UNKNOWN\020\217"
|
||||
"N*C\n\017CompareOperator\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n"
|
||||
"\002EQ\020\002\022\006\n\002GT\020\003\022\007\n\003GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022"
|
||||
"\013\n\007INVALID\020\000\022\010\n\004MUST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MU"
|
||||
"ST_NOT\020\0032\212\026\n\rMilvusService\022H\n\020CreateColl"
|
||||
"ection\022\035.milvus.grpc.CollectionSchema\032\023."
|
||||
"milvus.grpc.Status\"\000\022F\n\rHasCollection\022\033."
|
||||
"milvus.grpc.CollectionName\032\026.milvus.grpc"
|
||||
".BoolReply\"\000\022R\n\022DescribeCollection\022\033.mil"
|
||||
"vus.grpc.CollectionName\032\035.milvus.grpc.Co"
|
||||
"llectionSchema\"\000\022Q\n\017CountCollection\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\037.milvus.grpc.C"
|
||||
"ollectionRowCount\"\000\022J\n\017ShowCollections\022\024"
|
||||
".milvus.grpc.Command\032\037.milvus.grpc.Colle"
|
||||
"ctionNameList\"\000\022P\n\022ShowCollectionInfo\022\033."
|
||||
"milvus.grpc.CollectionName\032\033.milvus.grpc"
|
||||
".CollectionInfo\"\000\022D\n\016DropCollection\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\023.milvus.grpc.S"
|
||||
"tatus\"\000\022=\n\013CreateIndex\022\027.milvus.grpc.Ind"
|
||||
"exParam\032\023.milvus.grpc.Status\"\000\022G\n\rDescri"
|
||||
"beIndex\022\033.milvus.grpc.CollectionName\032\027.m"
|
||||
"ilvus.grpc.IndexParam\"\000\022\?\n\tDropIndex\022\033.m"
|
||||
"ilvus.grpc.CollectionName\032\023.milvus.grpc."
|
||||
"Status\"\000\022E\n\017CreatePartition\022\033.milvus.grp"
|
||||
"c.PartitionParam\032\023.milvus.grpc.Status\"\000\022"
|
||||
"K\n\016ShowPartitions\022\033.milvus.grpc.Collecti"
|
||||
"onName\032\032.milvus.grpc.PartitionList\"\000\022C\n\r"
|
||||
"DropPartition\022\033.milvus.grpc.PartitionPar"
|
||||
"am\032\023.milvus.grpc.Status\"\000\022<\n\006Insert\022\030.mi"
|
||||
"lvus.grpc.InsertParam\032\026.milvus.grpc.Vect"
|
||||
"orIds\"\000\022G\n\rGetVectorByID\022\033.milvus.grpc.V"
|
||||
"ectorIdentity\032\027.milvus.grpc.VectorData\"\000"
|
||||
"\022H\n\014GetVectorIDs\022\036.milvus.grpc.GetVector"
|
||||
"IDsParam\032\026.milvus.grpc.VectorIds\"\000\022B\n\006Se"
|
||||
"arch\022\030.milvus.grpc.SearchParam\032\034.milvus."
|
||||
"grpc.TopKQueryResult\"\000\022J\n\nSearchByID\022\034.m"
|
||||
"ilvus.grpc.SearchByIDParam\032\034.milvus.grpc"
|
||||
".TopKQueryResult\"\000\022P\n\rSearchInFiles\022\037.mi"
|
||||
"lvus.grpc.SearchInFilesParam\032\034.milvus.gr"
|
||||
"pc.TopKQueryResult\"\000\0227\n\003Cmd\022\024.milvus.grp"
|
||||
"c.Command\032\030.milvus.grpc.StringReply\"\000\022A\n"
|
||||
"\nDeleteByID\022\034.milvus.grpc.DeleteByIDPara"
|
||||
"m\032\023.milvus.grpc.Status\"\000\022G\n\021PreloadColle"
|
||||
"ction\022\033.milvus.grpc.CollectionName\032\023.mil"
|
||||
"vus.grpc.Status\"\000\0227\n\005Flush\022\027.milvus.grpc"
|
||||
".FlushParam\032\023.milvus.grpc.Status\"\000\022=\n\007Co"
|
||||
"mpact\022\033.milvus.grpc.CollectionName\032\023.mil"
|
||||
"vus.grpc.Status\"\000\022E\n\026CreateHybridCollect"
|
||||
"ion\022\024.milvus.grpc.Mapping\032\023.milvus.grpc."
|
||||
"Status\"\000\022L\n\023HasHybridCollection\022\033.milvus"
|
||||
".grpc.CollectionName\032\026.milvus.grpc.BoolR"
|
||||
"eply\"\000\022J\n\024DropHybridCollection\022\033.milvus."
|
||||
"grpc.CollectionName\032\023.milvus.grpc.Status"
|
||||
"\"\000\022D\n\014InsertEntity\022\031.milvus.grpc.HInsert"
|
||||
"Param\032\027.milvus.grpc.HEntityIDs\"\000\022I\n\014Hybr"
|
||||
"idSearch\022\031.milvus.grpc.HSearchParam\032\034.mi"
|
||||
"lvus.grpc.TopKQueryResult\"\000\022]\n\026HybridSea"
|
||||
"rchInSegments\022#.milvus.grpc.HSearchInSeg"
|
||||
"mentsParam\032\034.milvus.grpc.TopKQueryResult"
|
||||
"\"\000\022E\n\rGetEntityByID\022\034.milvus.grpc.HEntit"
|
||||
"yIdentity\032\024.milvus.grpc.HEntity\"\000\022J\n\014Get"
|
||||
"EntityIDs\022\037.milvus.grpc.HGetEntityIDsPar"
|
||||
"am\032\027.milvus.grpc.HEntityIDs\"\000\022J\n\022DeleteE"
|
||||
"ntitiesByID\022\035.milvus.grpc.HDeleteByIDPar"
|
||||
"am\032\023.milvus.grpc.Status\"\000b\006proto3"
|
||||
"\"\000\022O\n\030DescribeHybridCollection\022\033.milvus."
|
||||
"grpc.CollectionName\032\024.milvus.grpc.Mappin"
|
||||
"g\"\000\022W\n\025CountHybridCollection\022\033.milvus.gr"
|
||||
"pc.CollectionName\032\037.milvus.grpc.Collecti"
|
||||
"onRowCount\"\000\022I\n\025ShowHybridCollections\022\024."
|
||||
"milvus.grpc.Command\032\030.milvus.grpc.Mappin"
|
||||
"gList\"\000\022V\n\030ShowHybridCollectionInfo\022\033.mi"
|
||||
"lvus.grpc.CollectionName\032\033.milvus.grpc.C"
|
||||
"ollectionInfo\"\000\022M\n\027PreloadHybridCollecti"
|
||||
"on\022\033.milvus.grpc.CollectionName\032\023.milvus"
|
||||
".grpc.Status\"\000\022D\n\014InsertEntity\022\031.milvus."
|
||||
"grpc.HInsertParam\032\027.milvus.grpc.HEntityI"
|
||||
"Ds\"\000\022I\n\014HybridSearch\022\031.milvus.grpc.HSear"
|
||||
"chParam\032\034.milvus.grpc.TopKQueryResult\"\000\022"
|
||||
"]\n\026HybridSearchInSegments\022#.milvus.grpc."
|
||||
"HSearchInSegmentsParam\032\034.milvus.grpc.Top"
|
||||
"KQueryResult\"\000\022E\n\rGetEntityByID\022\034.milvus"
|
||||
".grpc.HEntityIdentity\032\024.milvus.grpc.HEnt"
|
||||
"ity\"\000\022J\n\014GetEntityIDs\022\037.milvus.grpc.HGet"
|
||||
"EntityIDsParam\032\027.milvus.grpc.HEntityIDs\""
|
||||
"\000\022J\n\022DeleteEntitiesByID\022\035.milvus.grpc.HD"
|
||||
"eleteByIDParam\032\023.milvus.grpc.Status\"\000b\006p"
|
||||
"roto3"
|
||||
;
|
||||
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_milvus_2eproto_deps[1] = {
|
||||
&::descriptor_table_status_2eproto,
|
||||
@ -1776,7 +1777,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mil
|
||||
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_milvus_2eproto_once;
|
||||
static bool descriptor_table_milvus_2eproto_initialized = false;
|
||||
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_milvus_2eproto = {
|
||||
&descriptor_table_milvus_2eproto_initialized, descriptor_table_protodef_milvus_2eproto, "milvus.proto", 8393,
|
||||
&descriptor_table_milvus_2eproto_initialized, descriptor_table_protodef_milvus_2eproto, "milvus.proto", 8405,
|
||||
&descriptor_table_milvus_2eproto_once, descriptor_table_milvus_2eproto_sccs, descriptor_table_milvus_2eproto_deps, 49, 1,
|
||||
schemas, file_default_instances, TableStruct_milvus_2eproto::offsets,
|
||||
file_level_metadata_milvus_2eproto, 50, file_level_enum_descriptors_milvus_2eproto, file_level_service_descriptors_milvus_2eproto,
|
||||
@ -13996,21 +13997,29 @@ TermQuery::TermQuery()
|
||||
TermQuery::TermQuery(const TermQuery& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(),
|
||||
_internal_metadata_(nullptr),
|
||||
values_(from.values_),
|
||||
extra_params_(from.extra_params_) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (!from.field_name().empty()) {
|
||||
field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_);
|
||||
}
|
||||
boost_ = from.boost_;
|
||||
values_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (!from.values().empty()) {
|
||||
values_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.values_);
|
||||
}
|
||||
::memcpy(&value_num_, &from.value_num_,
|
||||
static_cast<size_t>(reinterpret_cast<char*>(&boost_) -
|
||||
reinterpret_cast<char*>(&value_num_)) + sizeof(boost_));
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.grpc.TermQuery)
|
||||
}
|
||||
|
||||
void TermQuery::SharedCtor() {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TermQuery_milvus_2eproto.base);
|
||||
field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
boost_ = 0;
|
||||
values_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(&value_num_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&boost_) -
|
||||
reinterpret_cast<char*>(&value_num_)) + sizeof(boost_));
|
||||
}
|
||||
|
||||
TermQuery::~TermQuery() {
|
||||
@ -14020,6 +14029,7 @@ TermQuery::~TermQuery() {
|
||||
|
||||
void TermQuery::SharedDtor() {
|
||||
field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
values_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
|
||||
void TermQuery::SetCachedSize(int size) const {
|
||||
@ -14037,10 +14047,12 @@ void TermQuery::Clear() {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
values_.Clear();
|
||||
extra_params_.Clear();
|
||||
field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
boost_ = 0;
|
||||
values_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(&value_num_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&boost_) -
|
||||
reinterpret_cast<char*>(&value_num_)) + sizeof(boost_));
|
||||
_internal_metadata_.Clear();
|
||||
}
|
||||
|
||||
@ -14059,35 +14071,37 @@ const char* TermQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated string values = 2;
|
||||
// bytes values = 2;
|
||||
case 2:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_values(), ptr, ctx, "milvus.grpc.TermQuery.values");
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_values(), ptr, ctx);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
case 3:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
|
||||
value_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// float boost = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
|
||||
boost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
|
||||
ptr += sizeof(float);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
case 5:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(add_extra_params(), ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34);
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
default: {
|
||||
@ -14135,25 +14149,33 @@ bool TermQuery::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
// bytes values = 2;
|
||||
case 2: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
|
||||
input, this->add_values()));
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->values(this->values_size() - 1).data(),
|
||||
static_cast<int>(this->values(this->values_size() - 1).length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
|
||||
"milvus.grpc.TermQuery.values"));
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_values()));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
case 3: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (29 & 0xFF)) {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &value_num_)));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
|
||||
@ -14164,9 +14186,9 @@ bool TermQuery::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
case 5: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
|
||||
input, add_extra_params()));
|
||||
} else {
|
||||
@ -14212,26 +14234,27 @@ void TermQuery::SerializeWithCachedSizes(
|
||||
1, this->field_name(), output);
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
for (int i = 0, n = this->values_size(); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->values(i).data(), static_cast<int>(this->values(i).length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"milvus.grpc.TermQuery.values");
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
|
||||
2, this->values(i), output);
|
||||
// bytes values = 2;
|
||||
if (this->values().size() > 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
|
||||
2, this->values(), output);
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
if (this->value_num() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->value_num(), output);
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
if (!(this->boost() <= 0 && this->boost() >= 0)) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->boost(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(4, this->boost(), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->extra_params_size()); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
4,
|
||||
5,
|
||||
this->extra_params(static_cast<int>(i)),
|
||||
output);
|
||||
}
|
||||
@ -14260,27 +14283,29 @@ void TermQuery::SerializeWithCachedSizes(
|
||||
1, this->field_name(), target);
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
for (int i = 0, n = this->values_size(); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
|
||||
this->values(i).data(), static_cast<int>(this->values(i).length()),
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
|
||||
"milvus.grpc.TermQuery.values");
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
WriteStringToArray(2, this->values(i), target);
|
||||
// bytes values = 2;
|
||||
if (this->values().size() > 0) {
|
||||
target =
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
|
||||
2, this->values(), target);
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
if (this->value_num() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->value_num(), target);
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
if (!(this->boost() <= 0 && this->boost() >= 0)) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->boost(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->boost(), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->extra_params_size()); i < n; i++) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
4, this->extra_params(static_cast<int>(i)), target);
|
||||
5, this->extra_params(static_cast<int>(i)), target);
|
||||
}
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -14304,15 +14329,7 @@ size_t TermQuery::ByteSizeLong() const {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// repeated string values = 2;
|
||||
total_size += 1 *
|
||||
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->values_size());
|
||||
for (int i = 0, n = this->values_size(); i < n; i++) {
|
||||
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
|
||||
this->values(i));
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
{
|
||||
unsigned int count = static_cast<unsigned int>(this->extra_params_size());
|
||||
total_size += 1UL * count;
|
||||
@ -14330,7 +14347,21 @@ size_t TermQuery::ByteSizeLong() const {
|
||||
this->field_name());
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// bytes values = 2;
|
||||
if (this->values().size() > 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
|
||||
this->values());
|
||||
}
|
||||
|
||||
// int64 value_num = 3;
|
||||
if (this->value_num() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->value_num());
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
if (!(this->boost() <= 0 && this->boost() >= 0)) {
|
||||
total_size += 1 + 4;
|
||||
}
|
||||
@ -14362,12 +14393,18 @@ void TermQuery::MergeFrom(const TermQuery& from) {
|
||||
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
values_.MergeFrom(from.values_);
|
||||
extra_params_.MergeFrom(from.extra_params_);
|
||||
if (from.field_name().size() > 0) {
|
||||
|
||||
field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_);
|
||||
}
|
||||
if (from.values().size() > 0) {
|
||||
|
||||
values_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.values_);
|
||||
}
|
||||
if (from.value_num() != 0) {
|
||||
set_value_num(from.value_num());
|
||||
}
|
||||
if (!(from.boost() <= 0 && from.boost() >= 0)) {
|
||||
set_boost(from.boost());
|
||||
}
|
||||
@ -14394,10 +14431,12 @@ bool TermQuery::IsInitialized() const {
|
||||
void TermQuery::InternalSwap(TermQuery* other) {
|
||||
using std::swap;
|
||||
_internal_metadata_.Swap(&other->_internal_metadata_);
|
||||
values_.InternalSwap(CastToBase(&other->values_));
|
||||
CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_));
|
||||
field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
GetArenaNoVirtual());
|
||||
values_.Swap(&other->values_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
GetArenaNoVirtual());
|
||||
swap(value_num_, other->value_num_);
|
||||
swap(boost_, other->boost_);
|
||||
}
|
||||
|
||||
@ -17509,23 +17548,29 @@ HEntity::HEntity(const HEntity& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(),
|
||||
_internal_metadata_(nullptr),
|
||||
field_names_(from.field_names_),
|
||||
attr_records_(from.attr_records_),
|
||||
result_values_(from.result_values_) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
attr_records_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (!from.attr_records().empty()) {
|
||||
attr_records_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.attr_records_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
status_ = new ::milvus::grpc::Status(*from.status_);
|
||||
} else {
|
||||
status_ = nullptr;
|
||||
}
|
||||
entity_id_ = from.entity_id_;
|
||||
::memcpy(&entity_id_, &from.entity_id_,
|
||||
static_cast<size_t>(reinterpret_cast<char*>(&row_num_) -
|
||||
reinterpret_cast<char*>(&entity_id_)) + sizeof(row_num_));
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.grpc.HEntity)
|
||||
}
|
||||
|
||||
void HEntity::SharedCtor() {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HEntity_milvus_2eproto.base);
|
||||
attr_records_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(&status_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&entity_id_) -
|
||||
reinterpret_cast<char*>(&status_)) + sizeof(entity_id_));
|
||||
reinterpret_cast<char*>(&row_num_) -
|
||||
reinterpret_cast<char*>(&status_)) + sizeof(row_num_));
|
||||
}
|
||||
|
||||
HEntity::~HEntity() {
|
||||
@ -17534,6 +17579,7 @@ HEntity::~HEntity() {
|
||||
}
|
||||
|
||||
void HEntity::SharedDtor() {
|
||||
attr_records_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (this != internal_default_instance()) delete status_;
|
||||
}
|
||||
|
||||
@ -17553,13 +17599,15 @@ void HEntity::Clear() {
|
||||
(void) cached_has_bits;
|
||||
|
||||
field_names_.Clear();
|
||||
attr_records_.Clear();
|
||||
result_values_.Clear();
|
||||
attr_records_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
if (GetArenaNoVirtual() == nullptr && status_ != nullptr) {
|
||||
delete status_;
|
||||
}
|
||||
status_ = nullptr;
|
||||
entity_id_ = PROTOBUF_LONGLONG(0);
|
||||
::memset(&entity_id_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&row_num_) -
|
||||
reinterpret_cast<char*>(&entity_id_)) + sizeof(row_num_));
|
||||
_internal_metadata_.Clear();
|
||||
}
|
||||
|
||||
@ -17597,28 +17645,30 @@ const char* HEntity::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
// bytes attr_records = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(add_attr_records(), ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34);
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_attr_records(), ptr, ctx);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
case 5:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
|
||||
row_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
case 6:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
|
||||
ptr -= 1;
|
||||
do {
|
||||
ptr += 1;
|
||||
ptr = ctx->ParseMessage(add_result_values(), ptr);
|
||||
CHK_(ptr);
|
||||
if (!ctx->DataAvailable(ptr)) break;
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42);
|
||||
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
default: {
|
||||
@ -17691,20 +17741,33 @@ bool HEntity::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
// bytes attr_records = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
|
||||
input, add_attr_records()));
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_attr_records()));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
case 5: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &row_num_)));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
case 6: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
|
||||
DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
|
||||
input, add_result_values()));
|
||||
} else {
|
||||
@ -17761,20 +17824,22 @@ void HEntity::SerializeWithCachedSizes(
|
||||
3, this->field_names(i), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->attr_records_size()); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
4,
|
||||
this->attr_records(static_cast<int>(i)),
|
||||
output);
|
||||
// bytes attr_records = 4;
|
||||
if (this->attr_records().size() > 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
|
||||
4, this->attr_records(), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
if (this->row_num() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->row_num(), output);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->result_values_size()); i < n; i++) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
5,
|
||||
6,
|
||||
this->result_values(static_cast<int>(i)),
|
||||
output);
|
||||
}
|
||||
@ -17814,20 +17879,24 @@ void HEntity::SerializeWithCachedSizes(
|
||||
WriteStringToArray(3, this->field_names(i), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->attr_records_size()); i < n; i++) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
4, this->attr_records(static_cast<int>(i)), target);
|
||||
// bytes attr_records = 4;
|
||||
if (this->attr_records().size() > 0) {
|
||||
target =
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
|
||||
4, this->attr_records(), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
if (this->row_num() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->row_num(), target);
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
for (unsigned int i = 0,
|
||||
n = static_cast<unsigned int>(this->result_values_size()); i < n; i++) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
|
||||
InternalWriteMessageToArray(
|
||||
5, this->result_values(static_cast<int>(i)), target);
|
||||
6, this->result_values(static_cast<int>(i)), target);
|
||||
}
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -17859,18 +17928,7 @@ size_t HEntity::ByteSizeLong() const {
|
||||
this->field_names(i));
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
{
|
||||
unsigned int count = static_cast<unsigned int>(this->attr_records_size());
|
||||
total_size += 1UL * count;
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
total_size +=
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
|
||||
this->attr_records(static_cast<int>(i)));
|
||||
}
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
{
|
||||
unsigned int count = static_cast<unsigned int>(this->result_values_size());
|
||||
total_size += 1UL * count;
|
||||
@ -17881,6 +17939,13 @@ size_t HEntity::ByteSizeLong() const {
|
||||
}
|
||||
}
|
||||
|
||||
// bytes attr_records = 4;
|
||||
if (this->attr_records().size() > 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
|
||||
this->attr_records());
|
||||
}
|
||||
|
||||
// .milvus.grpc.Status status = 1;
|
||||
if (this->has_status()) {
|
||||
total_size += 1 +
|
||||
@ -17895,6 +17960,13 @@ size_t HEntity::ByteSizeLong() const {
|
||||
this->entity_id());
|
||||
}
|
||||
|
||||
// int64 row_num = 5;
|
||||
if (this->row_num() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->row_num());
|
||||
}
|
||||
|
||||
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
|
||||
SetCachedSize(cached_size);
|
||||
return total_size;
|
||||
@ -17923,14 +17995,20 @@ void HEntity::MergeFrom(const HEntity& from) {
|
||||
(void) cached_has_bits;
|
||||
|
||||
field_names_.MergeFrom(from.field_names_);
|
||||
attr_records_.MergeFrom(from.attr_records_);
|
||||
result_values_.MergeFrom(from.result_values_);
|
||||
if (from.attr_records().size() > 0) {
|
||||
|
||||
attr_records_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.attr_records_);
|
||||
}
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::milvus::grpc::Status::MergeFrom(from.status());
|
||||
}
|
||||
if (from.entity_id() != 0) {
|
||||
set_entity_id(from.entity_id());
|
||||
}
|
||||
if (from.row_num() != 0) {
|
||||
set_row_num(from.row_num());
|
||||
}
|
||||
}
|
||||
|
||||
void HEntity::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
|
||||
@ -17955,10 +18033,12 @@ void HEntity::InternalSwap(HEntity* other) {
|
||||
using std::swap;
|
||||
_internal_metadata_.Swap(&other->_internal_metadata_);
|
||||
field_names_.InternalSwap(CastToBase(&other->field_names_));
|
||||
CastToBase(&attr_records_)->InternalSwap(CastToBase(&other->attr_records_));
|
||||
CastToBase(&result_values_)->InternalSwap(CastToBase(&other->result_values_));
|
||||
attr_records_.Swap(&other->attr_records_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
GetArenaNoVirtual());
|
||||
swap(status_, other->status_);
|
||||
swap(entity_id_, other->entity_id_);
|
||||
swap(row_num_, other->row_num_);
|
||||
}
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::Metadata HEntity::GetMetadata() const {
|
||||
|
||||
@ -5656,29 +5656,13 @@ class TermQuery :
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kValuesFieldNumber = 2,
|
||||
kExtraParamsFieldNumber = 4,
|
||||
kExtraParamsFieldNumber = 5,
|
||||
kFieldNameFieldNumber = 1,
|
||||
kBoostFieldNumber = 3,
|
||||
kValuesFieldNumber = 2,
|
||||
kValueNumFieldNumber = 3,
|
||||
kBoostFieldNumber = 4,
|
||||
};
|
||||
// repeated string values = 2;
|
||||
int values_size() const;
|
||||
void clear_values();
|
||||
const std::string& values(int index) const;
|
||||
std::string* mutable_values(int index);
|
||||
void set_values(int index, const std::string& value);
|
||||
void set_values(int index, std::string&& value);
|
||||
void set_values(int index, const char* value);
|
||||
void set_values(int index, const char* value, size_t size);
|
||||
std::string* add_values();
|
||||
void add_values(const std::string& value);
|
||||
void add_values(std::string&& value);
|
||||
void add_values(const char* value);
|
||||
void add_values(const char* value, size_t size);
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& values() const;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_values();
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
int extra_params_size() const;
|
||||
void clear_extra_params();
|
||||
::milvus::grpc::KeyValuePair* mutable_extra_params(int index);
|
||||
@ -5700,7 +5684,23 @@ class TermQuery :
|
||||
std::string* release_field_name();
|
||||
void set_allocated_field_name(std::string* field_name);
|
||||
|
||||
// float boost = 3;
|
||||
// bytes values = 2;
|
||||
void clear_values();
|
||||
const std::string& values() const;
|
||||
void set_values(const std::string& value);
|
||||
void set_values(std::string&& value);
|
||||
void set_values(const char* value);
|
||||
void set_values(const void* value, size_t size);
|
||||
std::string* mutable_values();
|
||||
std::string* release_values();
|
||||
void set_allocated_values(std::string* values);
|
||||
|
||||
// int64 value_num = 3;
|
||||
void clear_value_num();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 value_num() const;
|
||||
void set_value_num(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// float boost = 4;
|
||||
void clear_boost();
|
||||
float boost() const;
|
||||
void set_boost(float value);
|
||||
@ -5710,9 +5710,10 @@ class TermQuery :
|
||||
class _Internal;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> values_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr values_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 value_num_;
|
||||
float boost_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
@ -7129,10 +7130,11 @@ class HEntity :
|
||||
|
||||
enum : int {
|
||||
kFieldNamesFieldNumber = 3,
|
||||
kResultValuesFieldNumber = 6,
|
||||
kAttrRecordsFieldNumber = 4,
|
||||
kResultValuesFieldNumber = 5,
|
||||
kStatusFieldNumber = 1,
|
||||
kEntityIdFieldNumber = 2,
|
||||
kRowNumFieldNumber = 5,
|
||||
};
|
||||
// repeated string field_names = 3;
|
||||
int field_names_size() const;
|
||||
@ -7151,18 +7153,7 @@ class HEntity :
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& field_names() const;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_field_names();
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
int attr_records_size() const;
|
||||
void clear_attr_records();
|
||||
::milvus::grpc::AttrRecord* mutable_attr_records(int index);
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >*
|
||||
mutable_attr_records();
|
||||
const ::milvus::grpc::AttrRecord& attr_records(int index) const;
|
||||
::milvus::grpc::AttrRecord* add_attr_records();
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >&
|
||||
attr_records() const;
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
int result_values_size() const;
|
||||
void clear_result_values();
|
||||
::milvus::grpc::FieldValue* mutable_result_values(int index);
|
||||
@ -7173,6 +7164,17 @@ class HEntity :
|
||||
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldValue >&
|
||||
result_values() const;
|
||||
|
||||
// bytes attr_records = 4;
|
||||
void clear_attr_records();
|
||||
const std::string& attr_records() const;
|
||||
void set_attr_records(const std::string& value);
|
||||
void set_attr_records(std::string&& value);
|
||||
void set_attr_records(const char* value);
|
||||
void set_attr_records(const void* value, size_t size);
|
||||
std::string* mutable_attr_records();
|
||||
std::string* release_attr_records();
|
||||
void set_allocated_attr_records(std::string* attr_records);
|
||||
|
||||
// .milvus.grpc.Status status = 1;
|
||||
bool has_status() const;
|
||||
void clear_status();
|
||||
@ -7186,16 +7188,22 @@ class HEntity :
|
||||
::PROTOBUF_NAMESPACE_ID::int64 entity_id() const;
|
||||
void set_entity_id(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 row_num = 5;
|
||||
void clear_row_num();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 row_num() const;
|
||||
void set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:milvus.grpc.HEntity)
|
||||
private:
|
||||
class _Internal;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> field_names_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord > attr_records_;
|
||||
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldValue > result_values_;
|
||||
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr attr_records_;
|
||||
::milvus::grpc::Status* status_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 entity_id_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 row_num_;
|
||||
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
|
||||
friend struct ::TableStruct_milvus_2eproto;
|
||||
};
|
||||
@ -12009,72 +12017,72 @@ inline void TermQuery::set_allocated_field_name(std::string* field_name) {
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.TermQuery.field_name)
|
||||
}
|
||||
|
||||
// repeated string values = 2;
|
||||
inline int TermQuery::values_size() const {
|
||||
return values_.size();
|
||||
}
|
||||
// bytes values = 2;
|
||||
inline void TermQuery::clear_values() {
|
||||
values_.Clear();
|
||||
values_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline const std::string& TermQuery::values(int index) const {
|
||||
inline const std::string& TermQuery::values() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.values)
|
||||
return values_.Get(index);
|
||||
return values_.GetNoArena();
|
||||
}
|
||||
inline std::string* TermQuery::mutable_values(int index) {
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TermQuery.values)
|
||||
return values_.Mutable(index);
|
||||
}
|
||||
inline void TermQuery::set_values(int index, const std::string& value) {
|
||||
inline void TermQuery::set_values(const std::string& value) {
|
||||
|
||||
values_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.values)
|
||||
values_.Mutable(index)->assign(value);
|
||||
}
|
||||
inline void TermQuery::set_values(int index, std::string&& value) {
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.values)
|
||||
values_.Mutable(index)->assign(std::move(value));
|
||||
inline void TermQuery::set_values(std::string&& value) {
|
||||
|
||||
values_.SetNoArena(
|
||||
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
|
||||
// @@protoc_insertion_point(field_set_rvalue:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::set_values(int index, const char* value) {
|
||||
inline void TermQuery::set_values(const char* value) {
|
||||
GOOGLE_DCHECK(value != nullptr);
|
||||
values_.Mutable(index)->assign(value);
|
||||
|
||||
values_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
|
||||
// @@protoc_insertion_point(field_set_char:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::set_values(int index, const char* value, size_t size) {
|
||||
values_.Mutable(index)->assign(
|
||||
reinterpret_cast<const char*>(value), size);
|
||||
inline void TermQuery::set_values(const void* value, size_t size) {
|
||||
|
||||
values_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
::std::string(reinterpret_cast<const char*>(value), size));
|
||||
// @@protoc_insertion_point(field_set_pointer:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline std::string* TermQuery::add_values() {
|
||||
// @@protoc_insertion_point(field_add_mutable:milvus.grpc.TermQuery.values)
|
||||
return values_.Add();
|
||||
inline std::string* TermQuery::mutable_values() {
|
||||
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.TermQuery.values)
|
||||
return values_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline void TermQuery::add_values(const std::string& value) {
|
||||
values_.Add()->assign(value);
|
||||
// @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.values)
|
||||
inline std::string* TermQuery::release_values() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.TermQuery.values)
|
||||
|
||||
return values_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline void TermQuery::add_values(std::string&& value) {
|
||||
values_.Add(std::move(value));
|
||||
// @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::add_values(const char* value) {
|
||||
GOOGLE_DCHECK(value != nullptr);
|
||||
values_.Add()->assign(value);
|
||||
// @@protoc_insertion_point(field_add_char:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline void TermQuery::add_values(const char* value, size_t size) {
|
||||
values_.Add()->assign(reinterpret_cast<const char*>(value), size);
|
||||
// @@protoc_insertion_point(field_add_pointer:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
|
||||
TermQuery::values() const {
|
||||
// @@protoc_insertion_point(field_list:milvus.grpc.TermQuery.values)
|
||||
return values_;
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
|
||||
TermQuery::mutable_values() {
|
||||
// @@protoc_insertion_point(field_mutable_list:milvus.grpc.TermQuery.values)
|
||||
return &values_;
|
||||
inline void TermQuery::set_allocated_values(std::string* values) {
|
||||
if (values != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
values_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), values);
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.TermQuery.values)
|
||||
}
|
||||
|
||||
// float boost = 3;
|
||||
// int64 value_num = 3;
|
||||
inline void TermQuery::clear_value_num() {
|
||||
value_num_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::int64 TermQuery::value_num() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.value_num)
|
||||
return value_num_;
|
||||
}
|
||||
inline void TermQuery::set_value_num(::PROTOBUF_NAMESPACE_ID::int64 value) {
|
||||
|
||||
value_num_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.value_num)
|
||||
}
|
||||
|
||||
// float boost = 4;
|
||||
inline void TermQuery::clear_boost() {
|
||||
boost_ = 0;
|
||||
}
|
||||
@ -12088,7 +12096,7 @@ inline void TermQuery::set_boost(float value) {
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.boost)
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 4;
|
||||
// repeated .milvus.grpc.KeyValuePair extra_params = 5;
|
||||
inline int TermQuery::extra_params_size() const {
|
||||
return extra_params_.size();
|
||||
}
|
||||
@ -13202,37 +13210,72 @@ HEntity::mutable_field_names() {
|
||||
return &field_names_;
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.AttrRecord attr_records = 4;
|
||||
inline int HEntity::attr_records_size() const {
|
||||
return attr_records_.size();
|
||||
}
|
||||
// bytes attr_records = 4;
|
||||
inline void HEntity::clear_attr_records() {
|
||||
attr_records_.Clear();
|
||||
attr_records_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline ::milvus::grpc::AttrRecord* HEntity::mutable_attr_records(int index) {
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.Mutable(index);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >*
|
||||
HEntity::mutable_attr_records() {
|
||||
// @@protoc_insertion_point(field_mutable_list:milvus.grpc.HEntity.attr_records)
|
||||
return &attr_records_;
|
||||
}
|
||||
inline const ::milvus::grpc::AttrRecord& HEntity::attr_records(int index) const {
|
||||
inline const std::string& HEntity::attr_records() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.Get(index);
|
||||
return attr_records_.GetNoArena();
|
||||
}
|
||||
inline ::milvus::grpc::AttrRecord* HEntity::add_attr_records() {
|
||||
// @@protoc_insertion_point(field_add:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.Add();
|
||||
inline void HEntity::set_attr_records(const std::string& value) {
|
||||
|
||||
attr_records_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value);
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::AttrRecord >&
|
||||
HEntity::attr_records() const {
|
||||
// @@protoc_insertion_point(field_list:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_;
|
||||
inline void HEntity::set_attr_records(std::string&& value) {
|
||||
|
||||
attr_records_.SetNoArena(
|
||||
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
|
||||
// @@protoc_insertion_point(field_set_rvalue:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline void HEntity::set_attr_records(const char* value) {
|
||||
GOOGLE_DCHECK(value != nullptr);
|
||||
|
||||
attr_records_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
|
||||
// @@protoc_insertion_point(field_set_char:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline void HEntity::set_attr_records(const void* value, size_t size) {
|
||||
|
||||
attr_records_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
||||
::std::string(reinterpret_cast<const char*>(value), size));
|
||||
// @@protoc_insertion_point(field_set_pointer:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
inline std::string* HEntity::mutable_attr_records() {
|
||||
|
||||
// @@protoc_insertion_point(field_mutable:milvus.grpc.HEntity.attr_records)
|
||||
return attr_records_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline std::string* HEntity::release_attr_records() {
|
||||
// @@protoc_insertion_point(field_release:milvus.grpc.HEntity.attr_records)
|
||||
|
||||
return attr_records_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
inline void HEntity::set_allocated_attr_records(std::string* attr_records) {
|
||||
if (attr_records != nullptr) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
attr_records_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), attr_records);
|
||||
// @@protoc_insertion_point(field_set_allocated:milvus.grpc.HEntity.attr_records)
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 5;
|
||||
// int64 row_num = 5;
|
||||
inline void HEntity::clear_row_num() {
|
||||
row_num_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::int64 HEntity::row_num() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.grpc.HEntity.row_num)
|
||||
return row_num_;
|
||||
}
|
||||
inline void HEntity::set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value) {
|
||||
|
||||
row_num_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.grpc.HEntity.row_num)
|
||||
}
|
||||
|
||||
// repeated .milvus.grpc.FieldValue result_values = 6;
|
||||
inline int HEntity::result_values_size() const {
|
||||
return result_values_.size();
|
||||
}
|
||||
|
||||
@ -629,17 +629,28 @@ ClientProxy::InsertEntity(const std::string& collection_name,
|
||||
grpc_param.set_collection_name(collection_name);
|
||||
grpc_param.set_partition_tag(partition_tag);
|
||||
|
||||
std::vector<std::vector<int8_t>> numerica_data;
|
||||
auto numerica_size = 0;
|
||||
|
||||
auto numerica_it = entities.numerica_value.begin();
|
||||
auto grpc_entity = grpc_param.mutable_entities();
|
||||
grpc_entity->set_row_num(entities.row_num);
|
||||
for (; numerica_it != entities.numerica_value.end(); numerica_it++) {
|
||||
auto name = grpc_param.mutable_entities()->add_field_names();
|
||||
auto name = grpc_entity->add_field_names();
|
||||
*name = numerica_it->first;
|
||||
auto records = grpc_param.mutable_entities()->add_attr_records();
|
||||
for (auto value : numerica_it->second) {
|
||||
auto attr = records->add_value();
|
||||
*attr = value;
|
||||
}
|
||||
auto size = numerica_it->second.size();
|
||||
numerica_size += size;
|
||||
numerica_data.emplace_back(numerica_it->second);
|
||||
}
|
||||
|
||||
std::vector<int8_t> attr_data(numerica_size, 0);
|
||||
size_t offset = 0;
|
||||
for (auto data : numerica_data) {
|
||||
memcpy(attr_data.data() + offset, data.data(), data.size());
|
||||
offset += data.size();
|
||||
}
|
||||
grpc_entity->set_attr_records(attr_data.data(), numerica_size);
|
||||
|
||||
auto vector_it = entities.vector_value.begin();
|
||||
for (; vector_it != entities.vector_value.end(); vector_it++) {
|
||||
auto name = grpc_param.mutable_entities()->add_field_names();
|
||||
@ -674,43 +685,44 @@ WriteQueryToProto(::milvus::grpc::GeneralQuery* general_query, BooleanQueryPtr b
|
||||
for (auto query : boolean_query->GetBooleanQueries()) {
|
||||
auto grpc_boolean_query = general_query->mutable_boolean_query();
|
||||
grpc_boolean_query->set_occur((::milvus::grpc::Occur)query->GetOccur());
|
||||
::milvus::grpc::GeneralQuery* next_query = grpc_boolean_query->add_general_query();
|
||||
WriteQueryToProto(next_query, query);
|
||||
}
|
||||
} else {
|
||||
for (auto leaf_query : boolean_query->GetLeafQueries()) {
|
||||
::milvus::grpc::GeneralQuery* grpc_query = general_query->mutable_boolean_query()->add_general_query();
|
||||
if (leaf_query->term_query_ptr != nullptr) {
|
||||
auto term_query = grpc_query->mutable_term_query();
|
||||
term_query->set_field_name(leaf_query->term_query_ptr->field_name);
|
||||
term_query->set_boost(leaf_query->query_boost);
|
||||
for (auto field_value : leaf_query->term_query_ptr->field_value) {
|
||||
auto value = term_query->add_values();
|
||||
*value = field_value;
|
||||
|
||||
for (auto leaf_query : query->GetLeafQueries()) {
|
||||
auto grpc_query = grpc_boolean_query->add_general_query();
|
||||
if (leaf_query->term_query_ptr != nullptr) {
|
||||
auto term_query = grpc_query->mutable_term_query();
|
||||
term_query->set_field_name(leaf_query->term_query_ptr->field_name);
|
||||
term_query->set_boost(leaf_query->query_boost);
|
||||
term_query->set_values(leaf_query->term_query_ptr->field_value.data(),
|
||||
leaf_query->term_query_ptr->field_value.size());
|
||||
}
|
||||
if (leaf_query->range_query_ptr != nullptr) {
|
||||
auto range_query = grpc_query->mutable_range_query();
|
||||
range_query->set_boost(leaf_query->query_boost);
|
||||
range_query->set_field_name(leaf_query->range_query_ptr->field_name);
|
||||
for (auto com_expr : leaf_query->range_query_ptr->compare_expr) {
|
||||
auto grpc_com_expr = range_query->add_operand();
|
||||
grpc_com_expr->set_operand(com_expr.operand);
|
||||
grpc_com_expr->set_operator_((milvus::grpc::CompareOperator)com_expr.compare_operator);
|
||||
}
|
||||
}
|
||||
if (leaf_query->vector_query_ptr != nullptr) {
|
||||
auto vector_query = grpc_query->mutable_vector_query();
|
||||
vector_query->set_field_name(leaf_query->vector_query_ptr->field_name);
|
||||
vector_query->set_query_boost(leaf_query->query_boost);
|
||||
vector_query->set_topk(leaf_query->vector_query_ptr->topk);
|
||||
for (auto record : leaf_query->vector_query_ptr->query_vector) {
|
||||
::milvus::grpc::RowRecord* row_record = vector_query->add_records();
|
||||
CopyRowRecord(row_record, record);
|
||||
}
|
||||
auto extra_param = vector_query->add_extra_params();
|
||||
extra_param->set_key(EXTRA_PARAM_KEY);
|
||||
extra_param->set_value(leaf_query->vector_query_ptr->extra_params);
|
||||
}
|
||||
}
|
||||
if (leaf_query->range_query_ptr != nullptr) {
|
||||
auto range_query = grpc_query->mutable_range_query();
|
||||
range_query->set_boost(leaf_query->query_boost);
|
||||
range_query->set_field_name(leaf_query->range_query_ptr->field_name);
|
||||
for (auto com_expr : leaf_query->range_query_ptr->compare_expr) {
|
||||
auto grpc_com_expr = range_query->add_operand();
|
||||
grpc_com_expr->set_operand(com_expr.operand);
|
||||
grpc_com_expr->set_operator_((milvus::grpc::CompareOperator)com_expr.compare_operator);
|
||||
}
|
||||
}
|
||||
if (leaf_query->vector_query_ptr != nullptr) {
|
||||
auto vector_query = grpc_query->mutable_vector_query();
|
||||
vector_query->set_field_name(leaf_query->vector_query_ptr->field_name);
|
||||
vector_query->set_query_boost(leaf_query->query_boost);
|
||||
vector_query->set_topk(leaf_query->vector_query_ptr->topk);
|
||||
for (auto record : leaf_query->vector_query_ptr->query_vector) {
|
||||
::milvus::grpc::RowRecord* row_record = vector_query->add_records();
|
||||
CopyRowRecord(row_record, record);
|
||||
}
|
||||
auto extra_param = vector_query->add_extra_params();
|
||||
extra_param->set_key(EXTRA_PARAM_KEY);
|
||||
extra_param->set_value(leaf_query->vector_query_ptr->extra_params);
|
||||
|
||||
if (!query->GetBooleanQueries().empty()) {
|
||||
::milvus::grpc::GeneralQuery* next_query = grpc_boolean_query->add_general_query();
|
||||
WriteQueryToProto(next_query, query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ struct QueryColumn {
|
||||
};
|
||||
|
||||
struct TermQuery : Query {
|
||||
std::vector<std::string> field_value;
|
||||
std::vector<int8_t> field_value;
|
||||
};
|
||||
using TermQueryPtr = std::shared_ptr<TermQuery>;
|
||||
|
||||
|
||||
@ -148,13 +148,12 @@ struct HMapping {
|
||||
};
|
||||
|
||||
struct HEntity {
|
||||
std::unordered_map<std::string, std::vector<std::string>> numerica_value;
|
||||
int64_t row_num;
|
||||
std::unordered_map<std::string, std::vector<int8_t>> numerica_value;
|
||||
std::unordered_map<std::string, std::vector<Entity>> vector_value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief SDK main class
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user