# Index only some of the fields

**URL:** <https://discuss.elastic.co/t/index-only-some-of-the-fields/10501>\
**Category:** Elasticsearch\
**Created:** [January 25, 2013, 6:56am UTC](https://discuss.elastic.co/t/index-only-some-of-the-fields/10501 "2013-01-25T06:56:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![11114](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11114/32/8524_2.png) [@11114](https://discuss.elastic.co/u/11114)\
**Post date:** [January 25, 2013, 6:56am UTC](https://discuss.elastic.co/t/index-only-some-of-the-fields/10501/1 "2013-01-25T06:56:04Z")

</div>

How can you do that he sought not his fields and the only which I will  
point out, I need to look for the 2 columns. column1 and column2

---

<div class="post-metadata">

**Author:** ![Artem\_Grinblat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_grinblat/32/2327_2.png) [@Artem\_Grinblat](https://discuss.elastic.co/u/Artem_Grinblat)\
**Post date:** [January 25, 2013, 12:01pm UTC](https://discuss.elastic.co/t/index-only-some-of-the-fields/10501/2 "2013-01-25T12:01:52Z")

</div>

You can use dynamic\_templates[http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html](http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html),  
for example, to index only the "index\__" fields:  
.mapping ("fx\_provider", """{"fx\_provider": {  
"\_all": {"enabled": false},  
"dynamic\_templates": {  
"no\_index\_by\_default": {  
"match": "_",  
"unmatch": "indexed\_\*",  
"mapping": {"type": "string", "index": "no"}  
}  
}  
}}"""))

пятница, 25 января 2013 г., 10:56:04 UTC+4 пользователь Николай Измайлов  
написал:

> How can you do that he sought not his fields and the only which I will  
> point out, I need to look for the 2 columns. column1 and column2

--

---

<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 6, 2017, 2:54am UTC](https://discuss.elastic.co/t/index-only-some-of-the-fields/10501/3 "2017-07-06T02:54:37Z")

</div>


