# Stored fields not coming back when the document is fetched

**URL:** <https://discuss.elastic.co/t/stored-fields-not-coming-back-when-the-document-is-fetched/9426>\
**Category:** Elasticsearch\
**Created:** [October 20, 2012, 4:10am UTC](https://discuss.elastic.co/t/stored-fields-not-coming-back-when-the-document-is-fetched/9426 "2012-10-20T04:10:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erdinc\_Yilmazel](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@Erdinc\_Yilmazel](https://discuss.elastic.co/u/Erdinc_Yilmazel)\
**Post date:** [October 20, 2012, 4:10am UTC](https://discuss.elastic.co/t/stored-fields-not-coming-back-when-the-document-is-fetched/9426/1 "2012-10-20T04:10:40Z")

</div>

Hi all,

I have a mapping that declares all individual fields to be stored. The  
\_source is disabled. (I know that this isn't recommended over \_source being  
enabled).

I put my documents into the index without a problem after creating an index  
with the following mapping and even if I specify the fields to be fetched  
using \_fields argument, I don't get the fields that I ask for back.

Mapping:

{  
"mappings":{  
"postalCode":{  
"\_type" : {"store" : "no"},  
"\_index" : { "enabled" : false },  
"\_source":{  
"enabled":false  
},  
"properties":{  
"countryCode":{"type":"string", "index":"analyzed",  
"store":"yes", "\_analyzer": {"path": "simple"}},  
"postalCode":{"type":"string", "index":"analyzed",  
"store":"yes", "\_analyzer": {"path": "simple"}},  
"geoCode":{"type":"geo\_point", "store":"yes"},  
"name":{"type":"string", "index":"analyzed", "store":"yes"},  
"state1":{"type":"string", "index":"analyzed",  
"store":"yes"},  
"state2":{"type":"string", "index":"analyzed",  
"store":"yes"},  
"county1":{"type":"string", "index":"analyzed",  
"store":"yes"},  
"county2":{"type":"string", "index":"analyzed",  
"store":"yes"},  
"community1":{"type":"string", "index":"analyzed",  
"store":"yes"},  
"community2":{"type":"string", "index":"analyzed",  
"store":"yes"},  
"region":{"type":"string", "index":"analyzed", "store":"no"}  
}  
}  
}  
}

My get request:

[http://localhost:9200/postalcodes/postalCode/100](http://localhost:9200/postalcodes/postalCode/100)??fields=postalCode,geoCode,name

Response:

{"\_index":"postalcodes","\_type":"postalCode","\_id":"100","\_version":1,"exists":true}

I am expecting to see the postalCode, geoCode and name fields in the response, but they don't exist. I don't want to see \_index and \_type in the returned json document but I still see them. What am I doing wrong?

Finally, when I go to [http://localhost:9200/postalcodes/postalCode/\_mapping](http://localhost:9200/postalcodes/postalCode/_mapping), I get a mapping back which isn't exactly the same as the mapping that I give to the create index command. I still get back all the fields and "store": "yes" properties, but the analyzer settings disappear.

I would appreciate any help.

Thanks,

Erdinc

--

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [October 20, 2012, 8:42am UTC](https://discuss.elastic.co/t/stored-fields-not-coming-back-when-the-document-is-fetched/9426/2 "2012-10-20T08:42:31Z")

</div>

Hiya

> [http://localhost:9200/postalcodes/postalCode/100](http://localhost:9200/postalcodes/postalCode/100)??fields=postalCode,geoCode,name

Could it be the double ??

> Finally, when I go to  
> [http://localhost:9200/postalcodes/postalCode/\_mapping](http://localhost:9200/postalcodes/postalCode/_mapping), I get a mapping  
> back which isn't exactly the same as the mapping that I give to the  
> create index command. I still get back all the fields and "store":  
> "yes" properties, but the analyzer settings disappear.

That's because you're using "\_analyzer" instead of "analyzer"

clint

--

---

<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, 3:07am UTC](https://discuss.elastic.co/t/stored-fields-not-coming-back-when-the-document-is-fetched/9426/3 "2017-07-06T03:07:53Z")

</div>


