Skip to content

Commit 10f8c8e

Browse files
authored
Add new extensible method to DocRequest to specify type (#19313)
* Add new extensible method to DocRequest to specify type Signed-off-by: Craig Perkins <[email protected]> * Add CHANGELOG entry Signed-off-by: Craig Perkins <[email protected]> * Add CHANGELOG entry Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
1 parent e4667f5 commit 10f8c8e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1919
- Publish transport-grpc-spi exposing QueryBuilderProtoConverter and QueryBuilderProtoConverterRegistry ([#18949](https://github.com/opensearch-project/OpenSearch/pull/18949))
2020
- Support system generated search pipeline. ([#19128](https://github.com/opensearch-project/OpenSearch/pull/19128))
2121
- Add `epoch_micros` date format ([#14669](https://github.com/opensearch-project/OpenSearch/issues/14669))
22-
- Grok processor supports capturing multiple values for same field name ([#18799](https://github.com/opensearch-project/OpenSearch/pull/18799)
22+
- Grok processor supports capturing multiple values for same field name ([#18799](https://github.com/opensearch-project/OpenSearch/pull/18799))
2323
- Upgrade opensearch-protobufs dependency to 0.13.0 and update transport-grpc module compatibility ([#19007](https://github.com/opensearch-project/OpenSearch/issues/19007))
24+
- Add new extensible method to DocRequest to specify type ([#19313](https://github.com/opensearch-project/OpenSearch/pull/19313))
2425

2526
### Changed
2627
- Refactor `if-else` chains to use `Java 17 pattern matching switch expressions`(([#18965](https://github.com/opensearch-project/OpenSearch/pull/18965))

server/src/main/java/org/opensearch/action/DocRequest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,18 @@ public interface DocRequest {
2828
* @return the id
2929
*/
3030
String id();
31+
32+
/**
33+
* Get the type of the request. This should match the action name prefix: i.e. indices:data/read/get
34+
*
35+
* Used in the context of resource sharing to specify the type of sharable resource.
36+
*
37+
* i.e. A report definition is sharable, so ActionRequests in the reporting plugin that
38+
* pertain to a single report definition would override this to specify "report_definition"
39+
*
40+
* @return the type
41+
*/
42+
default String type() {
43+
return "indices";
44+
}
3145
}

0 commit comments

Comments
 (0)