77 * License v3.0 only", or the "Server Side Public License, v 1".
88 */
99
10- package org .elasticsearch .index .codec .vectors ;
10+ package org .elasticsearch .index .codec .vectors . diskbbq ;
1111
1212import org .apache .lucene .codecs .KnnVectorsFormat ;
1313import org .apache .lucene .codecs .KnnVectorsReader ;
1717import org .apache .lucene .codecs .lucene99 .Lucene99FlatVectorsFormat ;
1818import org .apache .lucene .index .SegmentReadState ;
1919import org .apache .lucene .index .SegmentWriteState ;
20+ import org .elasticsearch .index .codec .vectors .OptimizedScalarQuantizer ;
2021
2122import java .io .IOException ;
2223
4243 * <p> Stores metadata including the number of centroids and their offsets in the clivf file</p>
4344 *
4445 */
45- public class IVFVectorsFormat extends KnnVectorsFormat {
46+ public class ES920DiskBBQVectorsFormat extends KnnVectorsFormat {
4647
47- public static final String NAME = "IVFVectorsFormat " ;
48+ public static final String NAME = "ES920DiskBBQVectorsFormat " ;
4849 // centroid ordinals -> centroid values, offsets
4950 public static final String CENTROID_EXTENSION = "cenivf" ;
5051 // offsets contained in cen_ivf, [vector ordinals, actually just docIds](long varint), quantized
@@ -72,7 +73,7 @@ public class IVFVectorsFormat extends KnnVectorsFormat {
7273 private final int vectorPerCluster ;
7374 private final int centroidsPerParentCluster ;
7475
75- public IVFVectorsFormat (int vectorPerCluster , int centroidsPerParentCluster ) {
76+ public ES920DiskBBQVectorsFormat (int vectorPerCluster , int centroidsPerParentCluster ) {
7677 super (NAME );
7778 if (vectorPerCluster < MIN_VECTORS_PER_CLUSTER || vectorPerCluster > MAX_VECTORS_PER_CLUSTER ) {
7879 throw new IllegalArgumentException (
@@ -99,18 +100,18 @@ public IVFVectorsFormat(int vectorPerCluster, int centroidsPerParentCluster) {
99100 }
100101
101102 /** Constructs a format using the given graph construction parameters and scalar quantization. */
102- public IVFVectorsFormat () {
103+ public ES920DiskBBQVectorsFormat () {
103104 this (DEFAULT_VECTORS_PER_CLUSTER , DEFAULT_CENTROIDS_PER_PARENT_CLUSTER );
104105 }
105106
106107 @ Override
107108 public KnnVectorsWriter fieldsWriter (SegmentWriteState state ) throws IOException {
108- return new DefaultIVFVectorsWriter (state , rawVectorFormat .fieldsWriter (state ), vectorPerCluster , centroidsPerParentCluster );
109+ return new ES920DiskBBQVectorsWriter (state , rawVectorFormat .fieldsWriter (state ), vectorPerCluster , centroidsPerParentCluster );
109110 }
110111
111112 @ Override
112113 public KnnVectorsReader fieldsReader (SegmentReadState state ) throws IOException {
113- return new DefaultIVFVectorsReader (state , rawVectorFormat .fieldsReader (state ));
114+ return new ES920DiskBBQVectorsReader (state , rawVectorFormat .fieldsReader (state ));
114115 }
115116
116117 @ Override
@@ -120,7 +121,7 @@ public int getMaxDimensions(String fieldName) {
120121
121122 @ Override
122123 public String toString () {
123- return "IVFVectorsFormat (" + "vectorPerCluster=" + vectorPerCluster + ')' ;
124+ return "ES920DiskBBQVectorsFormat (" + "vectorPerCluster=" + vectorPerCluster + ')' ;
124125 }
125126
126127}
0 commit comments