Fix reference to XContentBuilder.string() (#31337)

In 6.3 this was moved to `Strings.toString(XContentBuilder)` as part of the
XContent extraction. This commit fixes the docs to reference the new method.

Resolves #31326
This commit is contained in:
Lee Hinman 2018-06-18 15:04:26 -06:00 committed by GitHub
parent 2a8381d3fa
commit 4ad334f8e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -99,11 +99,13 @@ Note that you can also add arrays with `startArray(String)` and
other XContentBuilder objects. other XContentBuilder objects.
If you need to see the generated JSON content, you can use the If you need to see the generated JSON content, you can use the
`string()` method. `Strings.toString()` method.
[source,java] [source,java]
-------------------------------------------------- --------------------------------------------------
String json = builder.string(); import org.elasticsearch.common.Strings;
String json = Strings.toString(builder);
-------------------------------------------------- --------------------------------------------------