# Elasticsearch-mapper-attachments doesn't seems to be showing the actual text after searching instead returning base64 string

**URL:** <https://discuss.elastic.co/t/elasticsearch-mapper-attachments-doesnt-seems-to-be-showing-the-actual-text-after-searching-instead-returning-base64-string/40006>\
**Category:** Elasticsearch\
**Created:** [January 25, 2016, 10:09am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-doesnt-seems-to-be-showing-the-actual-text-after-searching-instead-returning-base64-string/40006 "2016-01-25T10:09:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin\_Sahu](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@Nitin\_Sahu](https://discuss.elastic.co/u/Nitin_Sahu)\
**Post date:** [January 25, 2016, 10:09am UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-doesnt-seems-to-be-showing-the-actual-text-after-searching-instead-returning-base64-string/40006/1 "2016-01-25T10:09:43Z")

</div>

```
      Steps I followed 

```

1. Installed elasticsearch 2.1.1

2. Installed mapper plugin using the below mentioned command

bin/plugin install elasticsearch/elasticsearch-mapper-attachments/3.1.1

1. Then I ran the following commands

DELETE /test  
PUT /test  
PUT /test/person/\_mapping  
{  
"person": {  
"properties": {  
"file": {  
"type": "attachment",  
"fields": {  
"content": {  
"type": "string",  
"term\_vector":"with\_positions\_offsets",  
"store": true  
}  
}  
}  
}  
}  
}  
PUT /test/person/1?refresh=true  
{  
"file": "IkdvZCBTYXZlIHRoZSBRdWVlbiIgKGFsdGVybmF0aXZlbHkgIkdvZCBTYXZlIHRoZSBLaW5nIg=="  
}  
GET /test/person/\_search  
{  
"fields": [],  
"query": {  
"match": {  
"file.content": "king queen"  
}  
},  
"highlight": {  
"fields": {  
"file.content": {  
}  
}  
}  
}

And the output which I get is mentioned below

{

```
"took": 1,
"timed_out": false,
"_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
},
"hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
        {
            "_index": "test",
            "_type": "person",
            "_id": "1",
            "_score": 1,
            "_source": {
                "file": "IkdvZCBTYXZlIHRoZSBRdWVlbiIgKGFsdGVybmF0aXZlbHkgIkdvZCBTYXZlIHRoZSBLaW5nIg=="
            }
        }
    ]
}

```

}

I was expecting something like this

{  
"took": 9,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 1,  
"max\_score": 0.13561106,  
"hits": [  
{  
"\_index": "test",  
"\_type": "person",  
"\_id": "1",  
"\_score": 0.13561106,  
"highlight": {  
"file.content": [  
""God Save the _Queen_" (alternatively "God Save the _King_"\n"  
]  
}  
}  
]  
}  
}

I am using Windows 8.1 and Java 1.8.0\_25

---

<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, 11:21pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-doesnt-seems-to-be-showing-the-actual-text-after-searching-instead-returning-base64-string/40006/2 "2017-07-05T23:21:58Z")

</div>


