# How to get a non-indexed field in \_field\_names?

**URL:** <https://discuss.elastic.co/t/how-to-get-a-non-indexed-field-in--field-names/91479>\
**Category:** Elasticsearch\
**Created:** [June 30, 2017, 6:07pm UTC](https://discuss.elastic.co/t/how-to-get-a-non-indexed-field-in--field-names/91479 "2017-06-30T18:07:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevan](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@trevan](https://discuss.elastic.co/u/trevan)\
**Post date:** [June 30, 2017, 6:07pm UTC](https://discuss.elastic.co/t/how-to-get-a-non-indexed-field-in--field-names/91479/1 "2017-06-30T18:07:44Z")

</div>

I want to have a field stored in \_source and available through \_all and be able to find the documents that has this particular field.

The mapping I'm trying to use is:

"fieldname" : {  
"type" : "keyword",  
"index" : false,  
"doc\_values" : false,  
"include\_in\_all" : true  
}

According to [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-field-names-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-field-names-field.html), \_field\_names should have every field that has non-null data. But it appears that I also need "index: true". That, unfortunately, adds memory overhead for the field.

Is there a way to get \_field\_names to have the field name in it without actually indexing the data in the field? I tried "index: true" and "index\_options: docs" but the value was still indexed. I tried adding "ignore\_above: 0" to prevent indexing of the value but then it stopped indexing the field name.

---

<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 28, 2017, 6:07pm UTC](https://discuss.elastic.co/t/how-to-get-a-non-indexed-field-in--field-names/91479/2 "2017-07-28T18:07:46Z")

</div>

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