# Why fields can not get doc value filed's content

**URL:** https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711
**Category:** Elasticsearch
**Created:** [March 31, 2014, 9:46am UTC](https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711 "2014-03-31T09:46:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![11141](https://avatars.discourse-cdn.com/v4/letter/1/e19adc/32.png) [@11141](https://discuss.elastic.co/u/11141)
#### Post date: [March 31, 2014, 9:46am UTC](https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711/1 "2014-03-31T09:46:19Z")

</div>

Hi all

I have a type named 'user', which mapping is following  
curl -XGET "localhost:9200/dv\_list/user/\_mapping?pretty=true"  
{  
"dv\_list" : {  
"mappings" : {  
"user" : {  
"\_source" : {  
"enabled" : false  
},  
"properties" : {  
"name" : {  
"type" : "string",  
"index" : "not\_analyzed",  
"store" : true  
},  
"point" : {  
"type" : "long",  
"index" : "no",  
"doc\_values" : true  
}  
}  
}  
}  
}  
}

when I execute following query,  
curl -XPOST '[http://localhost:9200/dv\_list/user/\_search?pretty=true](http://localhost:9200/dv_list/user/_search?pretty=true)' -d '{  
"query": {  
"match\_all": {  
}  
},  
"fields": ["point"]  
}'

The filed('point')'s content not returned by ES, result is  
{  
"took" : 3,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 7,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "5",  
"\_score" : 1.0  
}, {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "1",  
"\_score" : 1.0  
}, {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "6",  
"\_score" : 1.0  
}, {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "4",  
"\_score" : 1.0  
}, {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "2",  
"\_score" : 1.0  
}, {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "7",  
"\_score" : 1.0  
}, {  
"\_index" : "dv\_list",  
"\_type" : "user",  
"\_id" : "3",  
"\_score" : 1.0  
} ]  
}  
}

If I use "script\_fileds", the result can get through "doc['point'].value",  
but I think the performace of script\_fields is bad than fields'.

My ES version is 1.0.1.

Thanks

Zhao Chun

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f63c3b45-5f71-4d16-ab71-046dde16ae86%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f63c3b45-5f71-4d16-ab71-046dde16ae86%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)
#### Post date: [March 31, 2014, 9:53pm UTC](https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711/2 "2014-03-31T21:53:58Z")

</div>

In the mapping, if you set the point field to "store": "yes", you should be  
able to get it back.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![11141](https://avatars.discourse-cdn.com/v4/letter/1/e19adc/32.png) [@11141](https://discuss.elastic.co/u/11141)
#### Post date: [April 1, 2014, 1:52am UTC](https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711/3 "2014-04-01T01:52:18Z")

</div>

Thanks for your reply.

Field has been stored in the format Doc Value, if ES can get Doc Value data with “fields”, the same content only store one time and it is good to the memory which ES used.

在 2014年4月1日，上午5:53，Binh Ly [binhly\_es@yahoo.com](mailto:binhly_es@yahoo.com) 写道：

> In the mapping, if you set the point field to "store": "yes", you should be able to get it back.
> 
> --  
> You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/b\_\_n5t\_ATCM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/b__n5t_ATCM/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5C1319F6-8691-4566-8BA0-259E6047B5B9%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/5C1319F6-8691-4566-8BA0-259E6047B5B9%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![11141](https://avatars.discourse-cdn.com/v4/letter/1/e19adc/32.png) [@11141](https://discuss.elastic.co/u/11141)
#### Post date: [April 1, 2014, 6:09am UTC](https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711/4 "2014-04-01T06:09:44Z")

</div>

I solve my problem with "fielddata\_fields", and through reading source  
code, I guess this performance should be OK

Thanks

在 2014年4月1日星期二UTC+8上午9时52分18秒，Zhao Chun写道：

> Thanks for your reply.
> 
> Field has been stored in the format Doc Value, if ES can get Doc Value  
> data with “fields”, the same content only store one time and it is good to  
> the memory which ES used.
> 
> 在 2014年4月1日，上午5:53，Binh Ly [binhly\_es@yahoo.com](mailto:binhly_es@yahoo.com) 写道：
> 
> In the mapping, if you set the point field to "store": "yes", you should  
> be able to get it back.
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/b\_\_n5t\_ATCM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/b__n5t_ATCM/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d0bbaf57-7530-4e68-bcee-a0425f9a2986%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0e357d8c-a7f7-4040-8940-6c48d591de36%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0e357d8c-a7f7-4040-8940-6c48d591de36%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:39am UTC](https://discuss.elastic.co/t/why-fields-can-not-get-doc-value-fileds-content/16711/5 "2017-07-06T01:39:08Z")

</div>


