# How to search a encoded content

**URL:** <https://discuss.elastic.co/t/how-to-search-a-encoded-content/66495>\
**Category:** Elasticsearch\
**Created:** [November 18, 2016, 7:37am UTC](https://discuss.elastic.co/t/how-to-search-a-encoded-content/66495 "2016-11-18T07:37:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![radsan84](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@radsan84](https://discuss.elastic.co/u/radsan84)\
**Post date:** [November 18, 2016, 7:37am UTC](https://discuss.elastic.co/t/how-to-search-a-encoded-content/66495/1 "2016-11-18T07:37:45Z")

</div>

I indexed a base64 encoded content wih pipeline attachment;  
curl -XGET '[http://localhost:9200/myindex2/my\_type/my\_id?pretty](http://localhost:9200/myindex2/my_type/my_id?pretty)'  
shows me the index like

```
 "_source" : {
    "data" : "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=", 
      "attachment" : { "content_type" : "application/rtf", "content" : "Lorem ipsum dolor sit amet" ..}
                     } ....

```

I tried to do search the content 'dolor' using below command but i did not get the result. Could you please give the command to search the content ?  
curl -XGET '[http://localhost:9200/my\_index2/\_search?q=content:dolor](http://localhost:9200/my_index2/_search?q=content:dolor)'

Elastic search version i installed in 5.0.1

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 18, 2016, 8:03am UTC](https://discuss.elastic.co/t/how-to-search-a-encoded-content/66495/2 "2016-11-18T08:03:54Z")

</div>

try with attachment.content instead

---

<div class="post-metadata">

**Author:** ![radsan84](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@radsan84](https://discuss.elastic.co/u/radsan84)\
**Post date:** [November 18, 2016, 11:22am UTC](https://discuss.elastic.co/t/how-to-search-a-encoded-content/66495/3 "2016-11-18T11:22:36Z")

</div>

Thanks David.. attachment.content is working..

---

<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:** [December 16, 2016, 11:22am UTC](https://discuss.elastic.co/t/how-to-search-a-encoded-content/66495/4 "2016-12-16T11:22:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
