-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Describe the feature:
Kibana automatically queries all date fields in the index patterns as doc_values. There should be a way to choose which fields it requests as doc values. Or, better, it should request as doc values only fields actually relevant to the query.
Describe a specific use case for the feature:
This request has context coming from https://discuss.elastic.co/t/kibana-requesting-too-many-doc-values/147760
We have an elasticsearch cluster that indexes some events that flow through our system for debugging use. These events have pretty widely varying formats, so they end up generating a lot of different fields. Kibana maps about 2000 fields for the indexes. We don't configure these indexes manually, and just let Elasticsearch automatically generate indexes based on the data.
Performance has never been a problem. Type conflicts are pretty rare and haven't been problematic enough to warrant any action.
One day, I refreshed field mappings, and all search queries are breaking with the error:
{
"responses": [
{
"_shards": {
"failed": 95,
"failures": [
{
"index": "tracer--2018-09-07",
"node": "rMepPe8BS1m2ILlUDDQFmg",
"reason": {
"reason": "Trying to retrieve too many docvalue_fields. Must be less than or equal to: [100] but was [101]. This limit can be set by changing the [index.max_docvalue_fields_search] index level setting.",
"type": "illegal_argument_exception"
},
"shard": 0
}
],
"skipped": 5600,
"successful": 5600,
"total": 5695
},
"hits": {
"hits": [],
"max_score": 0.0,
"total": 0
},
"status": 200,
"timed_out": false,
"took": 2480
}
]
}
It looks like the indexes now have 101 different date type fields. Kibana seems to automatically request every date fields as docvalue fields in every single request.
These are for "Discover" requests, and we don't ever sort/aggregate on any of these fields. I've actually never had a need sort/aggregate on any of these date fields.
Rather than having to go and manually map these to strings, Kibana should be clever enough to not request them as doc values by examining the query. If that's not possible, there should at least be some way to configure the index template to restrict which fields are used as doc values.