When to use docvalue_fields

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?

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

Fields | Elasticsearch Reference [5.6] | Elastic 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.

And what about docvalue_fields?

Can you elaborate?

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?

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

Kibana uses docvalue_fields for date fields to get the value back in a consistent format. If Kibana used the value from _source, then parsing the date would be almost impossible because the formats would vary wildly from installation to installation.