diff --git a/src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java b/src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java index 42c12a5db..1db710bad 100644 --- a/src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java +++ b/src/main/java/org/opensearch/knn/index/mapper/MethodFieldMapper.java @@ -7,7 +7,6 @@ import org.apache.lucene.document.FieldType; import org.opensearch.common.Explicit; -import org.opensearch.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.knn.index.KNNMethodContext; import org.opensearch.knn.index.util.KNNEngine; @@ -50,7 +49,7 @@ public class MethodFieldMapper extends KNNVectorFieldMapper { try { this.fieldType.putAttribute( PARAMETERS, - Strings.toString(XContentFactory.jsonBuilder().map(knnEngine.getMethodAsMap(knnMethodContext))) + XContentFactory.jsonBuilder().map(knnEngine.getMethodAsMap(knnMethodContext)).toString() ); } catch (IOException ioe) { throw new RuntimeException(String.format("Unable to create KNNVectorFieldMapper: %s", ioe));