Add ConfAdapter to check search (#6971)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
pull/7124/head
yukun 2021-08-16 18:54:10 +08:00 committed by GitHub
parent 847586eb95
commit 61bda45e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,8 @@
#include "query/SearchOnSealed.h"
#include <knowhere/index/vector_index/VecIndex.h>
#include "knowhere/index/vector_index/ConfAdapter.h"
#include "knowhere/index/vector_index/ConfAdapterMgr.h"
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
#include "knowhere/index/vector_index/adapter/VectorAdapter.h"
#include <boost_ext/dynamic_bitset_ext.hpp>
@ -92,6 +94,9 @@ SearchOnSealed(const Schema& schema,
auto conf = search_info.search_params_;
conf[milvus::knowhere::meta::TOPK] = search_info.topk_;
conf[milvus::knowhere::Metric::TYPE] = MetricTypeToName(field_indexing->metric_type_);
auto index_type = field_indexing->indexing_->index_type();
auto adapter = milvus::knowhere::AdapterMgr::GetInstance().GetAdapter(index_type);
Assert(adapter->CheckSearch(conf, index_type, field_indexing->indexing_->index_mode()));
return field_indexing->indexing_->Query(ds, conf, bitset);
}();