@@ -16,6 +16,7 @@ import {
16
16
EuiLink ,
17
17
} from '@elastic/eui' ;
18
18
import {
19
+ BULK_API_DOCS_LINK ,
19
20
SEARCH_PIPELINE_DOCS_LINK ,
20
21
WORKFLOW_STEP_TYPE ,
21
22
WorkflowResource ,
@@ -25,6 +26,10 @@ interface ResourceFlyoutContentProps {
25
26
resource : WorkflowResource ;
26
27
resourceDetails : string ;
27
28
errorMessage ?: string ;
29
+ indexName ?: string ;
30
+ searchPipelineName ?: string ;
31
+ ingestPipelineName ?: string ;
32
+ searchQuery ?: string ;
28
33
}
29
34
30
35
/**
@@ -95,7 +100,7 @@ export function ResourceFlyoutContent(props: ResourceFlyoutContentProps) {
95
100
</ EuiTitle >
96
101
</ EuiFlexItem >
97
102
{ props . resource ?. stepType ===
98
- WORKFLOW_STEP_TYPE . CREATE_SEARCH_PIPELINE_STEP_TYPE && (
103
+ WORKFLOW_STEP_TYPE . CREATE_SEARCH_PIPELINE_STEP_TYPE ? (
99
104
< EuiFlexItem grow = { false } >
100
105
< EuiText size = "s" >
101
106
< p >
@@ -106,10 +111,25 @@ export function ResourceFlyoutContent(props: ResourceFlyoutContentProps) {
106
111
</ p >
107
112
</ EuiText >
108
113
</ EuiFlexItem >
114
+ ) : (
115
+ < EuiFlexItem grow = { false } >
116
+ < EuiText size = "s" >
117
+ < p >
118
+ You can ingest a larger amount of data using the Bulk API.{ ' ' }
119
+ < EuiLink href = { BULK_API_DOCS_LINK } target = "_blank" >
120
+ Learn more
121
+ </ EuiLink >
122
+ </ p >
123
+ </ EuiText >
124
+ </ EuiFlexItem >
109
125
) }
110
- < EuiFlexItem grow = { false } >
111
- < EuiCodeBlock fontSize = "m" isCopyable = { true } >
112
- { `GET /my_index/_search?search_pipeline=my_pipeline
126
+ { props . resource ?. stepType ===
127
+ WORKFLOW_STEP_TYPE . CREATE_SEARCH_PIPELINE_STEP_TYPE ? (
128
+ < EuiFlexItem grow = { false } >
129
+ < EuiCodeBlock fontSize = "m" isCopyable = { true } >
130
+ { `GET /${ props . indexName || 'my_index' } /_search?search_pipeline=${
131
+ props . searchPipelineName || 'my_pipeline'
132
+ }
113
133
{
114
134
"query": {
115
135
"term": {
@@ -119,8 +139,17 @@ export function ResourceFlyoutContent(props: ResourceFlyoutContentProps) {
119
139
}
120
140
}
121
141
}` }
122
- </ EuiCodeBlock >
123
- </ EuiFlexItem >
142
+ </ EuiCodeBlock >
143
+ </ EuiFlexItem >
144
+ ) : (
145
+ < EuiFlexItem grow = { false } >
146
+ < EuiCodeBlock fontSize = "m" isCopyable = { true } >
147
+ { `POST _bulk
148
+ { "index": { "_index": "${ props . indexName || 'my_index' } ", "_id": "abc123" } }
149
+ { "my_field_1": "my_field_value_1", "my_field_2": "my_field_value_2" }` }
150
+ </ EuiCodeBlock >
151
+ </ EuiFlexItem >
152
+ ) }
124
153
</ EuiFlexGroup >
125
154
) ;
126
155
}
0 commit comments