When I have mapping configured something like this:
$mapping = new Mapping(…);
$mapping->setProperties([
…
'my_attachments' => [ 'type' => 'attachment', 'include_in_all' => true ]
]);
It is storing base64 encoded content of the file and increasing index to the ridiculous size. How can I make sure that attachments do get indexed and searchable, but don't store their encoded content in the index?