Dargod
August 4, 2022, 11:35am
1
Is it possible to fully use the section Discover in Kibana with disabled _source?
I disabled this field and set option:
Read fields from _source (discover:searchFieldsFromSource) - False
However, I still get the error in Discover:
Unable to retrieve the requested [fields] since _source is disabled in the mappings for index [index]
If I return this field and make a rollout, then everything works fine, including those documents that were received when the field was disabled.
ELK stack 7.17.5
have you also removed the _source
field from the Meta Fields setting in Advanced Settings?
Dargod
August 15, 2022, 12:27pm
3
Yes, problem still exist.
Request:
{
"track_total_hits": false,
"sort": [
{
"@timestamp": {
"order": "desc",
"unmapped_type": "boolean"
}
}
],
"fields": [
{
"field": "*",
"include_unmapped": "true"
},
{
"field": "@timestamp",
"format": "strict_date_optional_time"
}
],
"size": 1000,
"version": true,
"script_fields": {},
"stored_fields": [
"*"
],
"runtime_mappings": {},
"_source": false,
"query": {
"bool": {
"must": [],
"filter": [
{
"range": {
"@timestamp": {
"format": "strict_date_optional_time",
"gte": "2022-08-15T12:11:41.275Z",
"lte": "2022-08-15T12:26:41.275Z"
}
}
}
],
"should": [],
"must_not": []
}
}
}
Response:
{
"took": 959,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 4,
"skipped": 4,
"failed": 1,
"failures": [
{
"shard": 0,
"index": "skk_test-000018",
"node": "5hbz3oOzRXG-BJO7_ebmZQ",
"reason": {
"type": "illegal_argument_exception",
"reason": "Unable to retrieve the requested [fields] since _source is disabled in the mappings for index [skk_test-000018]"
}
}
]
},
"hits": {
"max_score": null,
"hits": []
}
}
Based on this issue it looks like you have to update to 8.3.1 at least:
elastic:master
← javanna:fix/fetch_source_disabled
opened 06:55PM - 31 May 22 UTC
Back when we introduced the fields parameter to the search API, it could only fe… tch values from _source, hence
the corresponding sub-fetch phase fails early whenever _source is disabled. Today though runtime fields can
be retrieved from a separate value fetcher that reads from fielddata, and metadata fields can be retrieved
from stored fields. These two scenarios currently throw an unnecessary error whenever _source is disabled.
This commit removes the check for disabled _source, so that runtime fields and metadata fields can be retrieved even when _source is disabled. Fields that need to be loaded from _source are simply skipped whenever _source is disabled, similar to when a field is not found in _source.
Closes #87072
system
(system)
Closed
September 12, 2022, 3:00pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.