32 lines
583 B
Plaintext
32 lines
583 B
Plaintext
// 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: "set_bar",
|
|
description: "sets the value of bar from the field foo",
|
|
processors: [
|
|
{
|
|
set: {
|
|
field: "bar",
|
|
copy_from: "foo",
|
|
},
|
|
},
|
|
],
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.ingest.simulate({
|
|
id: "set_bar",
|
|
docs: [
|
|
{
|
|
_source: {
|
|
foo: ["foo1", "foo2"],
|
|
},
|
|
},
|
|
],
|
|
});
|
|
console.log(response1);
|
|
----
|