# Elastic search and attachment-mapping

**URL:** <https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430>\
**Category:** Elasticsearch\
**Created:** [November 12, 2015, 3:32pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430 "2015-11-12T15:32:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![adisajohnson](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@adisajohnson](https://discuss.elastic.co/u/adisajohnson)\
**Post date:** [November 12, 2015, 3:32pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/1 "2015-11-12T15:32:29Z")

</div>

Hello,

Trying to figure out how to use the attachment mapping by reading the readme: [https://github.com/elastic/elasticsearch-mapper-attachments](https://github.com/elastic/elasticsearch-mapper-attachments)

Are the fields of the mapping documented anywhere? For example, what does it mean when you map "store": true ? does it not store the content by default?

What does "path": full mean?

The (documentation) link in the first link on the readme is broken.

regards  
Adisa

---

<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 12, 2015, 3:52pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/2 "2015-11-12T15:52:14Z")

</div>

Make sure that you are reading the right version depending on your elasticsearch version:

- 1.7: [https://github.com/elastic/elasticsearch-mapper-attachments/tree/v2.7.1/#version-271-for-elasticsearch-17](https://github.com/elastic/elasticsearch-mapper-attachments/tree/v2.7.1/#version-271-for-elasticsearch-17)
- 2.0: [https://github.com/elastic/elasticsearch-mapper-attachments/tree/v3.0.2/#version-302-for-elasticsearch-20](https://github.com/elastic/elasticsearch-mapper-attachments/tree/v3.0.2/#version-302-for-elasticsearch-20)

`path` full does not exist anymore in 2.0

---

<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 12, 2015, 3:53pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/3 "2015-11-12T15:53:16Z")

</div>

Oh and by the way the documentation link is broken because we did not merge yet this PR: [https://github.com/elastic/elasticsearch/pull/14624](https://github.com/elastic/elasticsearch/pull/14624)

---

<div class="post-metadata">

**Author:** ![adisajohnson](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@adisajohnson](https://discuss.elastic.co/u/adisajohnson)\
**Post date:** [November 12, 2015, 4:02pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/4 "2015-11-12T16:02:43Z")

</div>

Thank you for this. I was originally looking at the 1.6.0 github repo when i was jotting down my questions.

Is the store: field deprecated as well? If not, what does it mean?

Also, once you index the base64 encoded content, it seems like the encoded content is what will be returned when you do \_search request on sense. And views like kibana also displays the content encoded.

I was only able to get the decoded content returned in sense when i enable highlight. Is this the correct behavior?

---

<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 12, 2015, 4:51pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/5 "2015-11-12T16:51:42Z")

</div>

> [@adisajohnson](#):
>
> s the store: field deprecated as well? If not, what does it mean?

No. See [store | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html)

> [@adisajohnson](#):
>
> Is this the correct behavior?

Yes. Elasticsearch gives you back what you sent as in `_source`. No less. No more.

---

<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 12, 2015, 4:53pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/6 "2015-11-12T16:53:05Z")

</div>

BTW you can also get the indexed content back without using highlighting but by storing the field and explicitly ask for it in your search request.

---

<div class="post-metadata">

**Author:** ![adisajohnson](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@adisajohnson](https://discuss.elastic.co/u/adisajohnson)\
**Post date:** [November 12, 2015, 5:52pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/7 "2015-11-12T17:52:12Z")

</div>

thanks.

> [@dadoonet](#):
>
> BTW you can also get the indexed content back without using highlighting but by storing the field and explicitly ask for it in your search request.

So i tried your suggestion, still comes out encoded. Please see below interpretation of ur suggestion.

> **POST** /trying-out-mapper-attachments  
> {  
> "mappings": {  
> "person": {  
> "properties": {  
> "cv": {  
> "type": "attachment",

> ```
> }
> 
> ```
> 
> }  
> }  
> }  
> }

> **PUT** /trying-out-mapper-attachments/person/1  
> {  
> "cv":"e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="

> }

> GET /trying-out-mapper-attachments/person/\_search?q= **cv:ipsum**

> returns cv encoded.

---

<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 12, 2015, 9:13pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/8 "2015-11-12T21:13:32Z")

</div>

I meant using that: [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-fields.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-fields.html)

---

<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:38pm UTC](https://discuss.elastic.co/t/elastic-search-and-attachment-mapping/34430/9 "2017-07-05T23:38:49Z")

</div>


