Browse Source

[Docs] Update method setSource(byte[] source) (#26561)

The method setSource(byte[]) from the type IndexRequestBuilder is deprecated,
use the method setSource(byte[] source, XContentType xContentType).
jiangzhuolin 8 years ago
parent
commit
a6d57f50f6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      docs/java-api/docs/index_.asciidoc

+ 1 - 1
docs/java-api/docs/index_.asciidoc

@@ -140,7 +140,7 @@ String json = "{" +
     "}";
 
 IndexResponse response = client.prepareIndex("twitter", "tweet")
-        .setSource(json)
+        .setSource(json, XContentType.JSON)
         .get();
 --------------------------------------------------