Improve BulkShardRequest.toString when it has only 1 internal request
Now that we use bulk for single item indexing, this is often the case. Having an indicator of the id of the indexed document helps debugging. It now looks like this `BulkShardRequest to [[test][0]] containing [index {[test][type][AVojzy9ZxfWASZ-ysmN7], source[{"auto":true}]}]`
This commit is contained in:
parent
90ea778c17
commit
33915aefd8
|
@ -85,8 +85,14 @@ public class BulkShardRequest extends ReplicatedWriteRequest<BulkShardRequest> {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// This is included in error messages so we'll try to make it somewhat user friendly.
|
// This is included in error messages so we'll try to make it somewhat user friendly.
|
||||||
StringBuilder b = new StringBuilder("BulkShardRequest to [");
|
StringBuilder b = new StringBuilder("BulkShardRequest [");
|
||||||
b.append(index).append("] containing [").append(items.length).append("] requests");
|
b.append(shardId).append("] containing [");
|
||||||
|
if (items.length > 1) {
|
||||||
|
b.append(items.length).append("] requests");
|
||||||
|
} else {
|
||||||
|
b.append(items[0].request()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
switch (getRefreshPolicy()) {
|
switch (getRefreshPolicy()) {
|
||||||
case IMMEDIATE:
|
case IMMEDIATE:
|
||||||
b.append(" and a refresh");
|
b.append(" and a refresh");
|
||||||
|
|
Loading…
Reference in New Issue