提交 b36a5247 编写于 作者: X Xu Peng

refactor(db): using traits


Former-commit-id: 6496aa13a3ba40d4bec2e32a1ad6f10377055775
上级 9e43c45d
......@@ -21,13 +21,10 @@ namespace zilliz {
namespace vecwise {
namespace engine {
const std::string RawIndexType = "IDMap,Flat";
const std::string BuildIndexType = "IVF"; // IDMap / IVF
template<class IndexTrait>
FaissExecutionEngine<IndexTrait>::FaissExecutionEngine(uint16_t dimension, const std::string& location)
: pIndex_(faiss::index_factory(dimension, RawIndexType.c_str())),
: pIndex_(faiss::index_factory(dimension, IndexTrait::RawIndexType)),
location_(location) {
}
......@@ -97,7 +94,7 @@ typename FaissExecutionEngine<IndexTrait>::Ptr
FaissExecutionEngine<IndexTrait>::BuildIndex(const std::string& location) {
auto opd = std::make_shared<Operand>();
opd->d = pIndex_->d;
opd->index_type = BuildIndexType;
opd->index_type = IndexTrait::BuildIndexType;
IndexBuilderPtr pBuilder = GetIndexBuilder(opd);
auto from_index = dynamic_cast<faiss::IndexIDMap*>(pIndex_.get());
......
......@@ -3,6 +3,7 @@
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#include "Traits.h"
namespace zilliz {
namespace vecwise {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册