diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java index 001896641cf4c..0352f39f1fc8a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java @@ -258,6 +258,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field("_type", type); } if (id != null) builder.field("_id", id); + if (fields != null) builder.field("fields", fields); // set values only when different from defaults if (requestPositions == false) builder.field("positions", false); if (requestPayloads == false) builder.field("payloads", false);