# Any way to specify fields not to index, but it should be stored

**URL:** <https://discuss.elastic.co/t/any-way-to-specify-fields-not-to-index-but-it-should-be-stored/145693>\
**Category:** Elasticsearch\
**Created:** [August 23, 2018, 10:04am UTC](https://discuss.elastic.co/t/any-way-to-specify-fields-not-to-index-but-it-should-be-stored/145693 "2018-08-23T10:04:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sangeeth\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Sangeeth\_Kumar](https://discuss.elastic.co/u/Sangeeth_Kumar)\
**Post date:** [August 23, 2018, 10:04am UTC](https://discuss.elastic.co/t/any-way-to-specify-fields-not-to-index-but-it-should-be-stored/145693/1 "2018-08-23T10:04:37Z")

</div>

I have Json data to index into my index. I would like to skip some specific fields like nested\_content before indexing a data.

Sample JSON data:

{  
"Name": "Sangeeth",  
"Cars": "Toyato",  
"nested\_content": {  
"object" : "value",  
"document" : {  
"object" : "document",  
"data" : {},  
"nodes" : [  
{  
"object" : "block",  
"type" : "paragraph",  
"isVoid" : false,  
"data" : {},  
"nodes" : [  
{  
"object" : "text",  
"leaves" : [  
{  
"object" : "leaf",  
"text" : "Hello This is my first post",  
"marks" : []  
}  
]  
}  
]  
}  
]  
}  
}  
}

Please let me know if any way to solve this.

---

<div class="post-metadata">

**Author:** ![jaddison](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jaddison](https://discuss.elastic.co/u/jaddison)\
**Post date:** [September 10, 2018, 3:28am UTC](https://discuss.elastic.co/t/any-way-to-specify-fields-not-to-index-but-it-should-be-stored/145693/2 "2018-09-10T03:28:21Z")

</div>

The typical way is to set `"index": false` for fields you don't want indexed, but they will be stored.

However, you can't do this with a `nested` object - the purpose of nesting is so that you can search against the sub-documents (the nested objects) 'correctly'. That being said, if you don't want the data indexed/query-able, then just use normal 'objects' rather than nested objects. Then you can use [the enabled option](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/enabled.html) to avoid indexing the object.

Edit: properly formatted/indented example code in questions will better enable people to answer.

---

<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 8, 2018, 3:28am UTC](https://discuss.elastic.co/t/any-way-to-specify-fields-not-to-index-but-it-should-be-stored/145693/3 "2018-10-08T03:28:22Z")

</div>

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