Use thread-safe search version of HnswGraphSearcher (#12246)

Addressing comment received in the PR https://github.com/apache/lucene/pull/12246
This commit is contained in:
Daniele Antuzi 2023-05-30 16:38:06 +02:00 committed by GitHub
parent 72b91156f3
commit da36c24cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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