38 lines
818 B
Plaintext
38 lines
818 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: "attachment",
|
|
description: "Extract attachment information",
|
|
processors: [
|
|
{
|
|
attachment: {
|
|
field: "data",
|
|
indexed_chars: 11,
|
|
indexed_chars_field: "max_size",
|
|
remove_binary: true,
|
|
},
|
|
},
|
|
],
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.index({
|
|
index: "my-index-000001",
|
|
id: "my_id",
|
|
pipeline: "attachment",
|
|
document: {
|
|
data: "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
|
|
},
|
|
});
|
|
console.log(response1);
|
|
|
|
const response2 = await client.get({
|
|
index: "my-index-000001",
|
|
id: "my_id",
|
|
});
|
|
console.log(response2);
|
|
----
|