Skip to content

Commit 20efdfd

Browse files
Add toString() to MultiSearchRequest class.
fix #12144 Signed-off-by: Guillaume Alvarez <7364145+guillaume-alvarez@users.noreply.github.com>
1 parent 57cc0dd commit 20efdfd

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8686
- Fix typo in API annotation check message ([11836](https://github.com/opensearch-project/OpenSearch/pull/11836))
8787
- Update supported version for must_exist parameter in update aliases API ([#11872](https://github.com/opensearch-project/OpenSearch/pull/11872))
8888
- [Bug] Check phase name before SearchRequestOperationsListener onPhaseStart ([#12035](https://github.com/opensearch-project/OpenSearch/pull/12035))
89+
- As toString methods to MultiSearchRequest, MultiGetRequest and CreateIndexRequest ([#12163](https://github.com/opensearch-project/OpenSearch/pull/12163))
8990

9091
### Security
9192

server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java

+21
Original file line numberDiff line numberDiff line change
@@ -594,4 +594,25 @@ public void writeTo(StreamOutput out) throws IOException {
594594
}
595595
waitForActiveShards.writeTo(out);
596596
}
597+
598+
@Override
599+
public String toString() {
600+
return "CreateIndexRequest{"
601+
+ "cause='"
602+
+ cause
603+
+ '\''
604+
+ ", index='"
605+
+ index
606+
+ '\''
607+
+ ", settings="
608+
+ settings
609+
+ ", mappings='"
610+
+ mappings
611+
+ '\''
612+
+ ", aliases="
613+
+ aliases
614+
+ ", waitForActiveShards="
615+
+ waitForActiveShards
616+
+ '}';
617+
}
597618
}

server/src/main/java/org/opensearch/action/get/MultiGetRequest.java

+15
Original file line numberDiff line numberDiff line change
@@ -583,4 +583,19 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
583583
return builder;
584584
}
585585

586+
@Override
587+
public String toString() {
588+
return "MultiGetRequest{"
589+
+ "preference='"
590+
+ preference
591+
+ '\''
592+
+ ", realtime="
593+
+ realtime
594+
+ ", refresh="
595+
+ refresh
596+
+ ", items="
597+
+ items
598+
+ '}';
599+
}
600+
586601
}

server/src/main/java/org/opensearch/action/search/MultiSearchRequest.java

+12
Original file line numberDiff line numberDiff line change
@@ -398,4 +398,16 @@ public boolean shouldCancelChildrenOnCancellation() {
398398
}
399399
};
400400
}
401+
402+
@Override
403+
public String toString() {
404+
return "MultiSearchRequest{"
405+
+ "maxConcurrentSearchRequests="
406+
+ maxConcurrentSearchRequests
407+
+ ", requests="
408+
+ requests
409+
+ ", indicesOptions="
410+
+ indicesOptions
411+
+ '}';
412+
}
401413
}

0 commit comments

Comments
 (0)