# Cannot use elasticsearch-mapper-attachments successfully

**URL:** <https://discuss.elastic.co/t/cannot-use-elasticsearch-mapper-attachments-successfully/51398>\
**Category:** Elasticsearch\
**Created:** [May 31, 2016, 8:26am UTC](https://discuss.elastic.co/t/cannot-use-elasticsearch-mapper-attachments-successfully/51398 "2016-05-31T08:26:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![245Bluesky](https://avatars.discourse-cdn.com/v4/letter/2/a8b319/32.png) [@245Bluesky](https://discuss.elastic.co/u/245Bluesky)\
**Post date:** [May 31, 2016, 8:26am UTC](https://discuss.elastic.co/t/cannot-use-elasticsearch-mapper-attachments-successfully/51398/1 "2016-05-31T08:26:26Z")

</div>

I tried to use elasticsearch-mapper-attachments plugin to parse and index DOCs.  
I have a problem after using the steps from Github([https://github.com/elastic/elasticsearch-mapper-attachments](https://github.com/elastic/elasticsearch-mapper-attachments)), and installed the plugin by command "sudo bin/plugin install mapper-attachments".  
When I search the word which is contained in the file, it just returns:

curl -XGET '[http://localhost:9200/docindex/attachment/\_search?q=queen](http://localhost:9200/docindex/attachment/_search?q=queen)'  
{"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":1,"max\_score":0.17807949,"hits":[{"\_index":"docindex","\_type":"attachment","\_id":"AVUEr3a0yjwKXQqIwoDd","\_score":0.17807949,"\_source":  
{  
"file": "IkdvZCBTYXZlIHRoZSBRdWVlbiIgKGFsdGVybmF0aXZlbHkgIkdvZCBTYXZlIHRoZSBLaW5nIg=="  
}}

It does not return the real content, just a base64 encoded string. And I can not find anything when using Kibana.

Its mapping looks like correct:

curl "[http://localhost:9200/docindex/\_mapping](http://localhost:9200/docindex/_mapping)"  
{"docindex":{"mappings":{"attachment":{"properties":{"\_indexed\_chars":{"type":"long"},"file":{"type":"attachment","fields":{"content":{"type":"string"},"author":{"type":"string"},"title":{"type":"string"},"name":{"type":"string"},"date":{"type":"date","format":"strict\_date\_optional\_time||epoch\_millis"},"keywords":{"type":"string"},"content\_type":{"type":"string"},"content\_length":{"type":"integer"},"language":{"type":"string"}}}}}}}}

How can I fix it?

My softwares are:  
jdk: 1.7.0\_76  
elasticsearch: 2.2.0

---

<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 5, 2017, 10:47pm UTC](https://discuss.elastic.co/t/cannot-use-elasticsearch-mapper-attachments-successfully/51398/2 "2017-07-05T22:47:46Z")

</div>


