Skip to content

Commit 7a77fbc

Browse files
committed
This utilizes new underlying lucene scorers where old defaults were used
1 parent de92d49 commit 7a77fbc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/ES813FlatVectorFormat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.apache.lucene.codecs.KnnVectorsFormat;
1414
import org.apache.lucene.codecs.KnnVectorsReader;
1515
import org.apache.lucene.codecs.KnnVectorsWriter;
16-
import org.apache.lucene.codecs.hnsw.DefaultFlatVectorScorer;
16+
import org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil;
1717
import org.apache.lucene.codecs.hnsw.FlatVectorsFormat;
1818
import org.apache.lucene.codecs.hnsw.FlatVectorsReader;
1919
import org.apache.lucene.codecs.hnsw.FlatVectorsWriter;
@@ -40,7 +40,7 @@ public class ES813FlatVectorFormat extends KnnVectorsFormat {
4040

4141
static final String NAME = "ES813FlatVectorFormat";
4242

43-
private static final FlatVectorsFormat format = new Lucene99FlatVectorsFormat(DefaultFlatVectorScorer.INSTANCE);
43+
private static final FlatVectorsFormat format = new Lucene99FlatVectorsFormat(FlatVectorScorerUtil.getLucene99FlatVectorsScorer());
4444

4545
/**
4646
* Sole constructor

server/src/main/java/org/elasticsearch/index/codec/vectors/ES814ScalarQuantizedVectorsFormat.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
package org.elasticsearch.index.codec.vectors;
1111

12-
import org.apache.lucene.codecs.hnsw.DefaultFlatVectorScorer;
1312
import org.apache.lucene.codecs.hnsw.FlatFieldVectorsWriter;
13+
import org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil;
1414
import org.apache.lucene.codecs.hnsw.FlatVectorsFormat;
1515
import org.apache.lucene.codecs.hnsw.FlatVectorsReader;
1616
import org.apache.lucene.codecs.hnsw.FlatVectorsScorer;
@@ -48,10 +48,12 @@ public class ES814ScalarQuantizedVectorsFormat extends FlatVectorsFormat {
4848
static final String NAME = "ES814ScalarQuantizedVectorsFormat";
4949
private static final int ALLOWED_BITS = (1 << 8) | (1 << 7) | (1 << 4);
5050

51-
private static final FlatVectorsFormat rawVectorFormat = new Lucene99FlatVectorsFormat(DefaultFlatVectorScorer.INSTANCE);
51+
private static final FlatVectorsFormat rawVectorFormat = new Lucene99FlatVectorsFormat(
52+
FlatVectorScorerUtil.getLucene99FlatVectorsScorer()
53+
);
5254

5355
static final FlatVectorsScorer flatVectorScorer = new ESFlatVectorsScorer(
54-
new ScalarQuantizedVectorScorer(DefaultFlatVectorScorer.INSTANCE)
56+
new ScalarQuantizedVectorScorer(FlatVectorScorerUtil.getLucene99FlatVectorsScorer())
5557
);
5658

5759
/** The minimum confidence interval */

0 commit comments

Comments
 (0)