Skip to content

Commit 67e4944

Browse files
committed
Add examples for ingest and search
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
1 parent 72f2aaf commit 67e4944

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

public/pages/workflow_detail/tools/resources/resource_flyout_content.tsx

+35-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
EuiLink,
1717
} from '@elastic/eui';
1818
import {
19+
BULK_API_DOCS_LINK,
1920
SEARCH_PIPELINE_DOCS_LINK,
2021
WORKFLOW_STEP_TYPE,
2122
WorkflowResource,
@@ -25,6 +26,10 @@ interface ResourceFlyoutContentProps {
2526
resource: WorkflowResource;
2627
resourceDetails: string;
2728
errorMessage?: string;
29+
indexName?: string;
30+
searchPipelineName?: string;
31+
ingestPipelineName?: string;
32+
searchQuery?: string;
2833
}
2934

3035
/**
@@ -95,7 +100,7 @@ export function ResourceFlyoutContent(props: ResourceFlyoutContentProps) {
95100
</EuiTitle>
96101
</EuiFlexItem>
97102
{props.resource?.stepType ===
98-
WORKFLOW_STEP_TYPE.CREATE_SEARCH_PIPELINE_STEP_TYPE && (
103+
WORKFLOW_STEP_TYPE.CREATE_SEARCH_PIPELINE_STEP_TYPE ? (
99104
<EuiFlexItem grow={false}>
100105
<EuiText size="s">
101106
<p>
@@ -106,10 +111,25 @@ export function ResourceFlyoutContent(props: ResourceFlyoutContentProps) {
106111
</p>
107112
</EuiText>
108113
</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>
109125
)}
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+
}
113133
{
114134
"query": {
115135
"term": {
@@ -119,8 +139,17 @@ export function ResourceFlyoutContent(props: ResourceFlyoutContentProps) {
119139
}
120140
}
121141
}`}
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+
)}
124153
</EuiFlexGroup>
125154
);
126155
}

0 commit comments

Comments
 (0)