diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db95ed90..083826031 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Set neural-search plugin 3.0.0 baseline JDK version to JDK-2 ([#838](https://github.com/opensearch-project/neural-search/pull/838)) ### Bug Fixes - Fix for nested field missing sub embedding field in text embedding processor ([#913](https://github.com/opensearch-project/neural-search/pull/913)) +- Correct NeuralQueryBuilder doEquals() and doHashCode(). ### Infrastructure ### Documentation ### Maintenance diff --git a/src/main/java/org/opensearch/neuralsearch/query/NeuralQueryBuilder.java b/src/main/java/org/opensearch/neuralsearch/query/NeuralQueryBuilder.java index 63ee0b7d6..791f944ce 100644 --- a/src/main/java/org/opensearch/neuralsearch/query/NeuralQueryBuilder.java +++ b/src/main/java/org/opensearch/neuralsearch/query/NeuralQueryBuilder.java @@ -117,8 +117,8 @@ public static void initialize(MLCommonsClientAccessor mlClient) { public NeuralQueryBuilder(StreamInput in) throws IOException { super(in); this.fieldName = in.readString(); - this.queryText = in.readString(); - this.queryImage = in.readString(); + this.queryText = in.readOptionalString(); + this.queryImage = in.readOptionalString(); // If cluster version is on or after 2.11 then default model Id support is enabled if (isClusterOnOrAfterMinReqVersionForDefaultModelIdSupport()) { this.modelId = in.readOptionalString(); @@ -147,8 +147,8 @@ public NeuralQueryBuilder(StreamInput in) throws IOException { @Override protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(this.fieldName); - out.writeString(this.queryText); - out.writeString(this.queryImage); + out.writeOptionalString(this.queryText); + out.writeOptionalString(this.queryImage); // If cluster version is on or after 2.11 then default model Id support is enabled if (isClusterOnOrAfterMinReqVersionForDefaultModelIdSupport()) { out.writeOptionalString(this.modelId);