Elastic search and attachment-mapping

(adisa johnson) #1


Trying to figure out how to use the attachment mapping by reading the readme: 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.


(David Pilato) #2

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

path full does not exist anymore in 2.0

(David Pilato) #3

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

(adisa johnson) #4

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?

(David Pilato) #5

No. See https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html

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

(David Pilato) #6

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.

(adisa johnson) #7


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


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

returns cv encoded.

(David Pilato) #8

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

(system) #9