svarup
(Svarup)
November 3, 2016, 1:55pm
1
How to force(override) ingest attachment properties.
What if I want to specify my own tittle, name, author, etc... of a document.
In mapper attachment plugin we use:
"my_attachment" : {
"_language" : "en",
"_tittle": "doc title",
"_content" : "... base64 encoded attachment ..."
}
How to do just like this in ingest attachment using php client.
1 Like
dadoonet
(David Pilato)
November 3, 2016, 2:26pm
2
You can use another processor in your pipeline to rename or remove fields.
2 Likes
evert
(evert)
November 3, 2016, 2:34pm
3
Nice question! I am trying to have some of these definitions as well...
Would be good if we have a sample of that, if you figure it out let us know.
svarup
(Svarup)
November 3, 2016, 2:45pm
4
@dadoonet can you sir give me example
1 Like
evert
(evert)
November 8, 2016, 12:36pm
5
Here is what I came up so far:
$params = [
'id' => 'attachment (pipeline name)',
'body' => [
'description' => 'Extract attachment information',
'processors' => [
[
'attachment' => [
'field' => 'content',
'indexed_chars' => -1
]
],
[
'set' => [
'field' => 'attachment.name',
'value' => '{{ name }}'
]
],
[
'set' => [
'field' => 'attachment.author',
'value' => '{{ author }}'
]
],
[
'set' => [
'field' => 'attachment.editor',
'value' => '{{ editor }}'
]
],
[
'remove' => [
'field' => 'name'
]
],
[
'remove' => [
'field' => 'author'
]
],
[
'remove' => [
'field' => 'editor'
]
],
]
]
];
return $client->ingest()->putPipeline($params);
Hope it heps!
1 Like
svarup
(Svarup)
November 8, 2016, 12:51pm
6
Thank you evert, thanks for support