# How to set elasticsearch field not to be indexed but still need it to be queryable

**URL:** <https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806>\
**Category:** Elasticsearch\
**Created:** [July 16, 2019, 5:42pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806 "2019-07-16T17:42:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![viphuangwei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viphuangwei/32/59306_2.png) [@viphuangwei](https://discuss.elastic.co/u/viphuangwei)\
**Post date:** [July 16, 2019, 5:42pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806/1 "2019-07-16T17:42:13Z")

</div>

e.g. "testcolumn" this field in index\_test , let's set it not as a full-txt index, but we still can use the query as below. How we can achieve this?

Post \_xpack/sql/  
{

"query": "select \* from index\_test where testcolumn= 'BVM'"  
}

---

<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:** [July 16, 2019, 6:12pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806/2 "2019-07-16T18:12:49Z")

</div>

Not sure about what you mean.

If it's not indexed, it's not searchable.

---

<div class="post-metadata">

**Author:** ![viphuangwei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viphuangwei/32/59306_2.png) [@viphuangwei](https://discuss.elastic.co/u/viphuangwei)\
**Post date:** [July 16, 2019, 6:58pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806/3 "2019-07-16T18:58:00Z")

</div>

can we set it to an not full-text index( not need to be analyzed), and still searchable.

---

<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:** [July 16, 2019, 7:10pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806/4 "2019-07-16T19:10:00Z")

</div>

`"type": "keyword"` will do it.

---

<div class="post-metadata">

**Author:** ![viphuangwei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viphuangwei/32/59306_2.png) [@viphuangwei](https://discuss.elastic.co/u/viphuangwei)\
**Post date:** [July 16, 2019, 7:14pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806/5 "2019-07-16T19:14:01Z")

</div>

Thank you! That work for me.

---

<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:** [August 13, 2019, 7:14pm UTC](https://discuss.elastic.co/t/how-to-set-elasticsearch-field-not-to-be-indexed-but-still-need-it-to-be-queryable/190806/6 "2019-08-13T19:14:08Z")

</div>

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