diff --git a/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java b/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java index 93a26f649c..98672841d7 100644 --- a/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java +++ b/common/src/main/java/org/opensearch/ml/common/dataset/TextDocsInputDataSet.java @@ -15,6 +15,7 @@ import org.opensearch.ml.common.output.model.ModelResultFilter; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -40,7 +41,11 @@ public TextDocsInputDataSet(List docs, ModelResultFilter resultFilter) { public TextDocsInputDataSet(StreamInput streamInput) throws IOException { super(MLInputDataType.TEXT_DOCS); - docs = streamInput.readStringList(); + docs = new ArrayList<>(); + int size = streamInput.readInt(); + for (int i=0; i