uchenily commented on code in PR #58130:
URL: https://github.com/apache/doris/pull/58130#discussion_r2563833101


##########
be/src/olap/rowset/segment_v2/ann_index/faiss_ann_index.cpp:
##########
@@ -340,6 +346,62 @@ void FaissVectorIndex::build(const FaissBuildParameter& 
params) {
         hnsw_index->hnsw.efConstruction = params.ef_construction;
 
         _index = std::move(hnsw_index);
+    } else if (params.index_type == FaissBuildParameter::IndexType::IVF) {
+        set_type(AnnIndexType::IVF);
+        std::unique_ptr<faiss::Index> ivf_index;
+        if (params.metric_type == FaissBuildParameter::MetricType::L2) {
+            _quantizer = std::make_unique<faiss::IndexFlat>(params.dim, 
faiss::METRIC_L2);

Review Comment:
   quantizer is a independent index used to assign vectors to clusters, here we 
use IndexFlat because flat index is accurate.
   (_quantizer is only used in IVF)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to