# Returning doc values with document API?

**URL:** <https://discuss.elastic.co/t/returning-doc-values-with-document-api/107408>\
**Category:** Elasticsearch\
**Created:** [November 13, 2017, 2:43pm UTC](https://discuss.elastic.co/t/returning-doc-values-with-document-api/107408 "2017-11-13T14:43:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Attila\_Nagy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/attila_nagy/32/46906_2.png) [@Attila\_Nagy](https://discuss.elastic.co/u/Attila_Nagy)\
**Post date:** [November 13, 2017, 2:43pm UTC](https://discuss.elastic.co/t/returning-doc-values-with-document-api/107408/1 "2017-11-13T14:43:50Z")

</div>

Hi,

Search API has the possibility to return doc value fields:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-docvalue-fields.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-docvalue-fields.html)  
Is it possible to do the same, but with the document API (simple GET)?

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 10, 2017, 4:55pm UTC](https://discuss.elastic.co/t/returning-doc-values-with-document-api/107408/2 "2017-12-10T16:55:40Z")

</div>

Unfortunately not. The Document GET implementation does not touches docvalues related data structures.

But you can combine the `docvalue_fields` option with an [Ids Query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html).

---

<div class="post-metadata">

**Author:** ![Attila\_Nagy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/attila_nagy/32/46906_2.png) [@Attila\_Nagy](https://discuss.elastic.co/u/Attila_Nagy)\
**Post date:** [December 11, 2017, 8:36am UTC](https://discuss.elastic.co/t/returning-doc-values-with-document-api/107408/3 "2017-12-11T08:36:01Z")

</div>

The biggest problem with query is it's not realtime... I've opened an issue and the conclusion there was the doc API should be converted to the internal search implementation while maintaining the realtime aspects.

---

<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:** [January 8, 2018, 8:36am UTC](https://discuss.elastic.co/t/returning-doc-values-with-document-api/107408/4 "2018-01-08T08:36:02Z")

</div>

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