From fa8407252aaefba87025ff3b58e808cb88150134 Mon Sep 17 00:00:00 2001 From: Junqiu Lei Date: Wed, 17 Apr 2024 15:09:57 -0700 Subject: [PATCH] Fix spotless Signed-off-by: Junqiu Lei --- .../knn/index/query/RNNQueryFactory.java | 20 +++++++++---------- .../knn/index/query/KNNQueryBuilderTests.java | 4 +++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/opensearch/knn/index/query/RNNQueryFactory.java b/src/main/java/org/opensearch/knn/index/query/RNNQueryFactory.java index 2818f5d6a..db8084864 100644 --- a/src/main/java/org/opensearch/knn/index/query/RNNQueryFactory.java +++ b/src/main/java/org/opensearch/knn/index/query/RNNQueryFactory.java @@ -120,11 +120,11 @@ private static Query getFloatVectorSimilarityQuery( final Query filterQuery ) { return new FloatVectorSimilarityQuery( - fieldName, - floatVector, - DEFAULT_LUCENE_RADIAL_SEARCH_TRAVERSAL_SIMILARITY_RATIO * resultSimilarity, - resultSimilarity, - filterQuery + fieldName, + floatVector, + DEFAULT_LUCENE_RADIAL_SEARCH_TRAVERSAL_SIMILARITY_RATIO * resultSimilarity, + resultSimilarity, + filterQuery ); } @@ -139,11 +139,11 @@ private static Query getByteVectorSimilarityQuery( final Query filterQuery ) { return new ByteVectorSimilarityQuery( - fieldName, - byteVector, - DEFAULT_LUCENE_RADIAL_SEARCH_TRAVERSAL_SIMILARITY_RATIO * resultSimilarity, - resultSimilarity, - filterQuery + fieldName, + byteVector, + DEFAULT_LUCENE_RADIAL_SEARCH_TRAVERSAL_SIMILARITY_RATIO * resultSimilarity, + resultSimilarity, + filterQuery ); } } diff --git a/src/test/java/org/opensearch/knn/index/query/KNNQueryBuilderTests.java b/src/test/java/org/opensearch/knn/index/query/KNNQueryBuilderTests.java index a0784d73a..134a5ab76 100644 --- a/src/test/java/org/opensearch/knn/index/query/KNNQueryBuilderTests.java +++ b/src/test/java/org/opensearch/knn/index/query/KNNQueryBuilderTests.java @@ -398,7 +398,9 @@ public void testDoToQuery_whenNormal_whenDoRadiusSearch_whenDistanceThreshold_th float resultSimilarity = KNNEngine.LUCENE.distanceToRadialThreshold(MAX_DISTANCE, SpaceType.L2); assertTrue(query.toString().contains("resultSimilarity=" + resultSimilarity)); - assertTrue(query.toString().contains("traversalSimilarity=" + DEFAULT_LUCENE_RADIAL_SEARCH_TRAVERSAL_SIMILARITY_RATIO * resultSimilarity)); + assertTrue( + query.toString().contains("traversalSimilarity=" + DEFAULT_LUCENE_RADIAL_SEARCH_TRAVERSAL_SIMILARITY_RATIO * resultSimilarity) + ); } public void testDoToQuery_whenNormal_whenDoRadiusSearch_whenScoreThreshold_thenSucceed() {