# Attachments plugin - has anyone been using this successfully?

**URL:** <https://discuss.elastic.co/t/attachments-plugin-has-anyone-been-using-this-successfully/3158>\
**Category:** Elasticsearch\
**Created:** [July 27, 2010, 8:41pm UTC](https://discuss.elastic.co/t/attachments-plugin-has-anyone-been-using-this-successfully/3158 "2010-07-27T20:41:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DKichler](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@DKichler](https://discuss.elastic.co/u/DKichler)\
**Post date:** [July 27, 2010, 8:41pm UTC](https://discuss.elastic.co/t/attachments-plugin-has-anyone-been-using-this-successfully/3158/1 "2010-07-27T20:41:43Z")

</div>

Hi there,

I've recently began playing around with ES and found the attachments plugin  
very interesting. I've implemented using the plugin, based on the brief  
description given in the  
docs[http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/](http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/)but  
could not get the results I expected. Now either my understanding of  
what the plugin does is inaccurate, or I've been using/mapping the plugin  
incorrectly somehow.

As I understand it, the attachments plugin is designed to bootstrap the  
content extraction capabilities provided by Tika.

Based on the small tutorial in the docs, the content is provided in the  
request as base64 encoded data. With minor changes to the most basic  
example, my mapping looks like:

{"properties" : {  
"file" : {  
"type" : "attachment",  
"fields" : {  
"file" : {"index" : "analyzed", "store" : "yes"},  
"date" : {"index" : "analyzed", "store" : "yes"}  
}  
}  
}}

The json document I pass with an index request looks like:

{ "file" : "JVBERi0xLjQNJeLjz9MNCjQ4IDAgb2JqPDw...." }  
(content is base64 encoded raw binary data read from a .pdf document)

Now, based on my limited understanding of how the attachment plugin works, I  
would expect it to pass the provided content through Tika's extraction  
process, then index the extracted content based on the mapping provided.  
However, when I retrieve the recently indexed document again, the file field  
contains only the raw base64 data that was provided with the index request  
(above). Am I missing something? is this the correct behaviour or have I  
implemented the plugin incorrectly?

Has anyone out there used this plugin extensively? or at all? Any tips on  
what I may be doing wrong are greatly appreciated.

Thanks,  
Dave K

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:21am UTC](https://discuss.elastic.co/t/attachments-plugin-has-anyone-been-using-this-successfully/3158/2 "2017-07-06T04:21:32Z")

</div>


