When to use docvalue_fields


(Shahar Mor) #1

Hi,

I see that Kibana is using docvalue_fields all the time for the @timestamp field.

When is using docvalue_fields vs stored_fields better? Is there a general use case? Aren't all fields fetched using doc_values anyway?


(Mark Walkom) #2

I'm not sure they are supposed to be interchangeable.

https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-stored-fields.html states;

The stored_fields parameter is about fields that are explicitly marked as stored in the mapping, which is off by default and generally not recommended.


(Shahar Mor) #3

And what about docvalue_fields?


(Mark Walkom) #4

Can you elaborate?


(Shahar Mor) #5

Sure.

There is this docvalue_fields option for the Search API: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-docvalue-fields.html

When should I use that?
My index has only keyword fields and all have doc_values enabled for them, so what does this option do in the Search API?


(system) #6

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