Auto-generated code for main (#2551)
This commit is contained in:
50
docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc
Normal file
50
docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc
Normal file
@ -0,0 +1,50 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.ingest.putPipeline({
|
||||
id: "attachment",
|
||||
description: "Extract attachment information from arrays",
|
||||
processors: [
|
||||
{
|
||||
foreach: {
|
||||
field: "attachments",
|
||||
processor: {
|
||||
attachment: {
|
||||
target_field: "_ingest._value.attachment",
|
||||
field: "_ingest._value.data",
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "my-index-000001",
|
||||
id: "my_id",
|
||||
pipeline: "attachment",
|
||||
document: {
|
||||
attachments: [
|
||||
{
|
||||
filename: "ipsum.txt",
|
||||
data: "dGhpcyBpcwpqdXN0IHNvbWUgdGV4dAo=",
|
||||
},
|
||||
{
|
||||
filename: "test.txt",
|
||||
data: "VGhpcyBpcyBhIHRlc3QK",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.get({
|
||||
index: "my-index-000001",
|
||||
id: "my_id",
|
||||
});
|
||||
console.log(response2);
|
||||
----
|
||||
Reference in New Issue
Block a user