You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2023/05/30 15:29:26 UTC

[lucene] 03/04: Use thread-safe search version of HnswGraphSearcher (#12246)

This is an automated email from the ASF dual-hosted git repository.

abenedetti pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 26e4f064e74d676688fe9581520a9a4b8b1d083a
Author: Daniele Antuzi <da...@gmail.com>
AuthorDate: Tue May 30 16:38:06 2023 +0200

    Use thread-safe search version of HnswGraphSearcher (#12246)
    
    Addressing comment received in the PR https://github.com/apache/lucene/pull/12246
---
 .../lucene/analysis/synonym/word2vec/Word2VecSynonymProvider.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/Word2VecSynonymProvider.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/Word2VecSynonymProvider.java
index 1d1f06fc991..167d94fb6e7 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/Word2VecSynonymProvider.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/word2vec/Word2VecSynonymProvider.java
@@ -27,10 +27,10 @@ import org.apache.lucene.index.VectorEncoding;
 import org.apache.lucene.index.VectorSimilarityFunction;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.TermAndBoost;
-import org.apache.lucene.util.hnsw.HnswGraph;
 import org.apache.lucene.util.hnsw.HnswGraphBuilder;
 import org.apache.lucene.util.hnsw.HnswGraphSearcher;
 import org.apache.lucene.util.hnsw.NeighborQueue;
+import org.apache.lucene.util.hnsw.OnHeapHnswGraph;
 
 /**
  * The Word2VecSynonymProvider generates the list of sysnonyms of a term.
@@ -43,7 +43,7 @@ public class Word2VecSynonymProvider {
       VectorSimilarityFunction.DOT_PRODUCT;
   private static final VectorEncoding VECTOR_ENCODING = VectorEncoding.FLOAT32;
   private final Word2VecModel word2VecModel;
-  private final HnswGraph hnswGraph;
+  private final OnHeapHnswGraph hnswGraph;
 
   /**
    * Word2VecSynonymProvider constructor