<p dir="auto">Hi,<br>
When I print SearchRequestBuilder to see json the "types" : [ ]<br>
Is this normal ?</p>
<p dir="auto">Follw-up of discussion we had in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="59470640" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/9944" data-hovercard-type="pull_request" data-hovercard-url="/elastic/elasticsearch/pull/9944/hovercard" href="https://github.com/elastic/elasticsearch/pull/9944">#9944</a>. After <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="53763293" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/9201" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/9201/hovercard" href="https://github.com/elastic/elasticsearch/issues/9201">#9201</a>, we should look into having consistent <code class="notranslate">toString()</code> implementations for all of our requests (I think builders will be gone by then) and responses.</p>
<p dir="auto">Topics to discuss: when it comes to search requests we currently print out only part of the requests in json format. I'd propose to move away from json format in general, which is trappy as it makes users think that the json can be sent back to elasticsearch as is (although not complete). I would just make sure that we print out every single bit that the request holds (e.g. at the moment search request builder ignores index, type, routing etc.).</p>
<p dir="auto">In general, <code class="notranslate">toString</code> should only be a way to nicely debug requests and their content and quickly log them, it doesn't need to be json and it needs to contain all the relevant info for every class that implements it.</p>