# Is it possible to get query results from document values?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-get-query-results-from-document-values/20946
**Category:** Elasticsearch
**Created:** [November 25, 2014, 9:31pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-query-results-from-document-values/20946 "2014-11-25T21:31:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tzahi](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tzahi](https://discuss.elastic.co/u/Tzahi)
#### Post date: [November 25, 2014, 9:31pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-query-results-from-document-values/20946/1 "2014-11-25T21:31:32Z")

</div>

Hi all,

I need to query an index with tens of millions of short documents.

The result set may contain \> 100,000 documents, and I need to process a  
single field from each document. It those are simple stored fields in \*.fdt  
file - it will take forever +-.

I thought document values will answer my need of reading a single field  
from each document. But I cannot make it work.

Is there a way to make a query return a single field that is stored in doc  
value from the \*.dvd file, as opposed to slowely digging it from the \*.fdt  
file ?

Thanks

--  
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/7f18b409-c70f-4bef-88cc-96661fe5710f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f18b409-c70f-4bef-88cc-96661fe5710f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [November 25, 2014, 9:39pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-query-results-from-document-values/20946/2 "2014-11-25T21:39:33Z")

</div>

If you need all of them in the client application then I think the only  
options are to use fields  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)  
to fetch from stored fields

I imagine some aggregations uses doc values though I haven't looked at the  
code to be sure.

Nik

On Tue, Nov 25, 2014 at 4:31 PM, Tzahi jakubovitz [tzahij@hotmail.com](mailto:tzahij@hotmail.com)  
wrote:

> Hi all,
> 
> I need to query an index with tens of millions of short documents.
> 
> The result set may contain \> 100,000 documents, and I need to process a  
> single field from each document. It those are simple stored fields in \*.fdt  
> file - it will take forever +-.
> 
> I thought document values will answer my need of reading a single field  
> from each document. But I cannot make it work.
> 
> Is there a way to make a query return a single field that is stored in doc  
> value from the \*.dvd file, as opposed to slowely digging it from the \*.fdt  
> file ?
> 
> Thanks
> 
> --  
> 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/7f18b409-c70f-4bef-88cc-96661fe5710f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f18b409-c70f-4bef-88cc-96661fe5710f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7f18b409-c70f-4bef-88cc-96661fe5710f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7f18b409-c70f-4bef-88cc-96661fe5710f%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/CAPmjWd3BYjfxJqwwtVfv0tPWG6HP3vNvMw0oCPjBF-6fLZRX5w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3BYjfxJqwwtVfv0tPWG6HP3vNvMw0oCPjBF-6fLZRX5w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Tzahi](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tzahi](https://discuss.elastic.co/u/Tzahi)
#### Post date: [November 25, 2014, 10:10pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-query-results-from-document-values/20946/3 "2014-11-25T22:10:39Z")

</div>

> 

Thanks so much.

But the answer is very frustrating.

Getting large result sets will always be slow - even if I need just a  
single field.

Only aggregations and facets enjoy document fields - we commoners need to  
dig our fields from the \*.fdt file.  
Bugger – and thanks again

--  
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/b7454911-b5e5-4a89-b0aa-2b24ef324246%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7454911-b5e5-4a89-b0aa-2b24ef324246%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, 12:47am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-query-results-from-document-values/20946/4 "2017-07-06T00:47:36Z")

</div>


