# Index only and do not store in source

**URL:** <https://discuss.elastic.co/t/index-only-and-do-not-store-in-source/249283>\
**Category:** Elasticsearch\
**Created:** [September 20, 2020, 8:47pm UTC](https://discuss.elastic.co/t/index-only-and-do-not-store-in-source/249283 "2020-09-20T20:47:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Mangal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_mangal/32/75899_2.png) [@Ankit\_Mangal](https://discuss.elastic.co/u/Ankit_Mangal)\
**Post date:** [September 20, 2020, 8:47pm UTC](https://discuss.elastic.co/t/index-only-and-do-not-store-in-source/249283/1 "2020-09-20T20:47:04Z")

</div>

I was looking for a feature where i can pass first name, last name as plain string to Elasticsearch and just index these fields so i can search but do not store them in source (Due to PII data).

Came across this `copy_to` feature where i can store multiple fields from source but the original fields need to be there in source.

Any suggestions please.

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 20, 2020, 9:14pm UTC](https://discuss.elastic.co/t/index-only-and-do-not-store-in-source/249283/2 "2020-09-20T21:14:47Z")

</div>

Welcome to our community! 😃

You need to disable that in the mapping, see [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html)

---

<div class="post-metadata">

**Author:** ![Ankit\_Mangal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_mangal/32/75899_2.png) [@Ankit\_Mangal](https://discuss.elastic.co/u/Ankit_Mangal)\
**Post date:** [September 21, 2020, 7:31pm UTC](https://discuss.elastic.co/t/index-only-and-do-not-store-in-source/249283/3 "2020-09-21T19:31:37Z")

</div>

Thanks @warkolm,

This is exactly what i was looking for, I didn't know that we can exclude certain fields from `_source ` after indexing is done so they are only available for search and not in the `_source` as plain text.

---

<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:** [October 19, 2020, 7:38pm UTC](https://discuss.elastic.co/t/index-only-and-do-not-store-in-source/249283/5 "2020-10-19T19:38:07Z")

</div>

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