Skip to content

Conversation

@Hearen
Copy link
Contributor

@Hearen Hearen commented Aug 30, 2019

builder.getOutputStream().toString() will do the trick while builder.string() only prints the object reference (kind of address like "org.elasticsearch.common.xcontent.XContentBuilder@66e889df")

`builder.getOutputStream().toString()` will do the trick while `builder.string()` only prints the object reference (kind of address)
@polyfractal polyfractal added :Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch >docs General docs changes labels Aug 30, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@cbuescher
Copy link
Member

Hi @Hearen, thanks for spotting this, you are right, the string() method was removed from XContentBuilder so the docs need update. I tracked down the change to that removed the method to PR #28972 and it looks like calling the static Strings.toString(XContentBuilder xContentBuilder) helper in org.elasticsearch.common.Strings is now the preferred way of replacing the removed method. Would you mind changing your PR to that since its more succinct?

@cbuescher cbuescher self-assigned this Sep 4, 2019
@cbuescher
Copy link
Member

@Hearen thanks for the update, I will run our test suite (although this is a small docs patch) before merging.
@elasticmachine test this please

@cbuescher
Copy link
Member

@elasticmachine update branch

@cbuescher
Copy link
Member

@elasticmachine test this please

@cbuescher
Copy link
Member

The failing docs checks cannot be run on 5.x because of some CI build changes that haven't been backported. Merging regardless since this change only concerns a docs code block that should not be run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch >docs General docs changes v5.5.4 v5.6.17 v6.0.3 v6.1.3 v6.2.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants