diff --git a/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java b/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java index 3f8493d7a4f14..0341ea2c925b2 100644 --- a/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java +++ b/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java @@ -352,25 +352,25 @@ public void writeRawField(String name, InputStream content) throws IOException { */ @Override public void writeRawField(String name, InputStream content, MediaType mediaType) throws IOException { - if (mayWriteRawData(mediaType) == false) { - // EMPTY is safe here because we never call namedObject when writing raw data - try ( - XContentParser parser = mediaType.xContent() - // It's okay to pass the throwing deprecation handler - // because we should not be writing raw fields when - // generating JSON - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, content) - ) { - parser.nextToken(); - writeFieldName(name); - copyCurrentStructure(parser); - } - } else { +// if (mayWriteRawData(mediaType) == false) { +// // EMPTY is safe here because we never call namedObject when writing raw data +// try ( +// XContentParser parser = mediaType.xContent() +// // It's okay to pass the throwing deprecation handler +// // because we should not be writing raw fields when +// // generating JSON +// .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, content) +// ) { +// parser.nextToken(); +// writeFieldName(name); +// copyCurrentStructure(parser); +// } +// } else { writeStartRaw(name); flush(); Streams.copy(content, os); writeEndRaw(); - } +// } } /** diff --git a/server/src/main/java/org/opensearch/search/SearchHits.java b/server/src/main/java/org/opensearch/search/SearchHits.java index ab67eecee65a0..80307cc303f5e 100644 --- a/server/src/main/java/org/opensearch/search/SearchHits.java +++ b/server/src/main/java/org/opensearch/search/SearchHits.java @@ -272,12 +272,12 @@ public SearchHitsProtoDef.SearchHitsProto toProto() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - System.out.println("SearchHits.toXContent"); +// System.out.println("SearchHits.toXContent"); builder.startObject(Fields.HITS); com.google.protobuf.ByteString bString = toProto().toByteString(); - System.out.println("Client response size: " + bString.size()); +// System.out.println("Client response size: " + bString.size()); builder.rawField("protobuf", bString.newInput(), MediaType.fromMediaType("application/octet-stream")); diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java index fa8759e73cb3b..7155a897f187b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java @@ -67,7 +67,7 @@ public FetchSearchResult() {} //////////////////////////////////////////////// public FetchSearchResult(StreamInput in) throws IOException { - System.out.println("FetchSearchResult In - PROTOBUF"); +// System.out.println("FetchSearchResult In - PROTOBUF"); FetchSearchResultProtoDef.FetchSearchResultProto proto = FetchSearchResultProtoDef.FetchSearchResultProto.parseFrom(in); hits = new SearchHitsProtobuf(proto.getHits()); } @@ -81,7 +81,7 @@ FetchSearchResultProtoDef.FetchSearchResultProto toProto() { @Override public void writeTo(StreamOutput out) throws IOException { - System.out.println("FetchSearchResult Out - PROTOBUF"); +// System.out.println("FetchSearchResult Out - PROTOBUF"); toProto().writeTo(out); }