# Elasticsearch-mapper-attachments where is the text content stored?

**URL:** <https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634>\
**Category:** Elasticsearch\
**Created:** [October 9, 2018, 12:41pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634 "2018-10-09T12:41:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ekazaltzis](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@ekazaltzis](https://discuss.elastic.co/u/ekazaltzis)\
**Post date:** [October 9, 2018, 12:41pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634/1 "2018-10-09T12:41:24Z")

</div>

Hi,

I'm using the elasticsearch-mapper-attachments plugin and I would like to also see the TIKA converted text content as part of the document. I have tried the following mapping without success:

curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d'  
{  
"mappings": {  
"person" : {  
"properties" : {  
"copy":{type:"string"},  
"file" : {  
"type" : "attachment",  
"fields" : {  
"content" : {"store" : true,type:"string", "copy\_to":"copy"},  
"title" : {"store" : true},  
"date" : {"store" : true},  
"keywords" : {"store" : true},  
"content\_type" : {"store" : true},  
"content\_length" : {"store" : true},  
"language" : {"store" : true}  
}  
}  
}  
}  
}  
}  
'  
The text content is not available in the "copy" field not in the file.content. Is there a way to have the text content stored?

---

<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:** [October 9, 2018, 12:57pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634/2 "2018-10-09T12:57:28Z")

</div>

You can mark the field as stored. It's in the documentation IIRC.  
But anyway this plugin has been removed in recent versions so don't use it.

Use ingest-attachment instead.

---

<div class="post-metadata">

**Author:** ![ekazaltzis](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@ekazaltzis](https://discuss.elastic.co/u/ekazaltzis)\
**Post date:** [October 10, 2018, 3:54pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634/3 "2018-10-10T15:54:20Z")

</div>

Hi according to me the content field is marked as stored but I guess you mean that I should mark the copy field as stored,. I'll give it a try.  
I'm using ES 2.4.6 can I use the ingest-attachment on this version?

Thanks,  
Emanouil

---

<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:** [October 10, 2018, 4:12pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634/4 "2018-10-10T16:12:02Z")

</div>

I think ingest came out in 5.0.  
It's time for you to upgrade instead of investing time on deprecated/removed features I guess.

As the content field is stored you can just retrieve its content without having to copy to (which is not supported in this context IIRC)

---

<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:** [November 7, 2018, 4:12pm UTC](https://discuss.elastic.co/t/elasticsearch-mapper-attachments-where-is-the-text-content-stored/151634/5 "2018-11-07T16:12:04Z")

</div>

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