diff --git a/cpp/src/wrapper/Index.cpp b/cpp/src/wrapper/Index.cpp index 35dd646fdfdc95fc129ad89517087ac7796e9a04..c306b65e1a354b2cfb042bf27264004cab3b2218 100644 --- a/cpp/src/wrapper/Index.cpp +++ b/cpp/src/wrapper/Index.cpp @@ -13,6 +13,7 @@ #include "Index.h" #include "faiss/index_io.h" +#include "faiss/IndexIVF.h" namespace zilliz { namespace milvus { @@ -55,6 +56,9 @@ bool Index::add_with_ids(idx_t n, const float *xdata, const long *xids) { bool Index::search(idx_t n, const float *data, idx_t k, float *distances, long *labels) const { try { + if(auto ivf_index = std::dynamic_pointer_cast(index_)) { + ivf_index->nprobe = 100; + } index_->search(n, data, k, distances, labels); } catch (std::exception &e) { diff --git a/cpp/src/wrapper/Operand.cpp b/cpp/src/wrapper/Operand.cpp index 25341676a67fd2ceebdef5f1a421a06b22f8d290..30e31067fd67523d771c68246147a8650ed7c2e2 100644 --- a/cpp/src/wrapper/Operand.cpp +++ b/cpp/src/wrapper/Operand.cpp @@ -39,7 +39,7 @@ string Operand::get_index_type(const int &nb) { } case IVF: { index_str += (ncent != 0 ? index_type + std::to_string(ncent) : - index_type + std::to_string(int(nb / 1000000.0 * 16384))); + index_type + std::to_string(int(nb / 1000000.0 * 1638))); break; } case IDMAP: {