@@ -148,8 +148,10 @@ public void testFullPrecisionVectorSimilarityDVS() throws Exception {
148148 float [] queryVector = TestVectorUtil .randomVector (VECTOR_DIMENSION );
149149 try (IndexReader reader = DirectoryReader .open (dir )) {
150150 for (LeafReaderContext ctx : reader .leaves ()) {
151- DoubleValues fpSimValues = FloatVectorSimilarityValuesSource .fullPrecisionScores (ctx , queryVector , KNN_FIELD );
152- DoubleValues quantizedSimValues = DoubleValuesSource .similarityToQueryVector (ctx , queryVector , KNN_FIELD );
151+ DoubleValues fpSimValues =
152+ FloatVectorSimilarityValuesSource .fullPrecisionScores (ctx , queryVector , KNN_FIELD );
153+ DoubleValues quantizedSimValues =
154+ DoubleValuesSource .similarityToQueryVector (ctx , queryVector , KNN_FIELD );
153155 // validate when segment has no vectors
154156 if (fpSimValues == DoubleValues .EMPTY || quantizedSimValues == DoubleValues .EMPTY ) {
155157 assertEquals (fpSimValues , quantizedSimValues );
@@ -195,9 +197,9 @@ public void testFullPrecisionByteVectorSimilarityDVS() throws Exception {
195197
196198 // index some 4 bit quantized vectors
197199 try (IndexWriter w =
198- new IndexWriter (
199- dir ,
200- newIndexWriterConfig ().setCodec (TestUtil .alwaysKnnVectorsFormat (getKnnFormat (4 ))))) {
200+ new IndexWriter (
201+ dir ,
202+ newIndexWriterConfig ().setCodec (TestUtil .alwaysKnnVectorsFormat (getKnnFormat (4 ))))) {
201203 for (int j = 0 ; j < numSegments ; j ++) {
202204 for (int i = 0 ; i < numVectors ; i ++) {
203205 Document doc = new Document ();
@@ -226,9 +228,9 @@ public void testFullPrecisionByteVectorSimilarityDVS() throws Exception {
226228
227229 // index some 7 bit quantized vectors
228230 try (IndexWriter w =
229- new IndexWriter (
230- dir ,
231- newIndexWriterConfig ().setCodec (TestUtil .alwaysKnnVectorsFormat (getKnnFormat (7 ))))) {
231+ new IndexWriter (
232+ dir ,
233+ newIndexWriterConfig ().setCodec (TestUtil .alwaysKnnVectorsFormat (getKnnFormat (7 ))))) {
232234 for (int j = 0 ; j < numSegments ; j ++) {
233235 for (int i = 0 ; i < numVectors ; i ++) {
234236 Document doc = new Document ();
@@ -258,8 +260,10 @@ public void testFullPrecisionByteVectorSimilarityDVS() throws Exception {
258260 byte [] queryVector = TestVectorUtil .randomVectorBytes (VECTOR_DIMENSION );
259261 try (IndexReader reader = DirectoryReader .open (dir )) {
260262 for (LeafReaderContext ctx : reader .leaves ()) {
261- DoubleValues fpSimValues = ByteVectorSimilarityValuesSource .fullPrecisionScores (ctx , queryVector , KNN_FIELD );
262- DoubleValues quantizedSimValues = DoubleValuesSource .similarityToQueryVector (ctx , queryVector , KNN_FIELD );
263+ DoubleValues fpSimValues =
264+ ByteVectorSimilarityValuesSource .fullPrecisionScores (ctx , queryVector , KNN_FIELD );
265+ DoubleValues quantizedSimValues =
266+ DoubleValuesSource .similarityToQueryVector (ctx , queryVector , KNN_FIELD );
263267 // validate when segment has no vectors
264268 if (fpSimValues == DoubleValues .EMPTY || quantizedSimValues == DoubleValues .EMPTY ) {
265269 assertEquals (fpSimValues , quantizedSimValues );
0 commit comments