Report shard failures in the field_capabilities response (#11450)
This commit is contained in:
parent
5ba57f7c62
commit
5db50dec17
|
@ -22,7 +22,12 @@ export function registerFieldCapabilities(server) {
|
|||
return _.pick(value, ['searchable', 'aggregatable']);
|
||||
});
|
||||
|
||||
reply({ fields: fieldsFilteredValues });
|
||||
const retVal = { fields: fieldsFilteredValues };
|
||||
if (res._shards && res._shards.failed) {
|
||||
retVal.shard_failure_response = res;
|
||||
}
|
||||
|
||||
reply(retVal);
|
||||
},
|
||||
(error) => {
|
||||
reply(handleESError(error));
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
import chrome from 'ui/chrome';
|
||||
import _ from 'lodash';
|
||||
import { Notifier } from 'ui/notify/notifier';
|
||||
import { ShardFailure } from 'ui/errors';
|
||||
|
||||
export function EnhanceFieldsWithCapabilitiesProvider($http) {
|
||||
const notifier = new Notifier({
|
||||
location: 'Field Capabilities'
|
||||
});
|
||||
|
||||
return function (fields, indices) {
|
||||
return $http.get(chrome.addBasePath(`/api/kibana/${indices}/field_capabilities`))
|
||||
.then((res) => {
|
||||
if (_.get(res, 'data.shard_failure_response')) {
|
||||
notifier.warning(new ShardFailure(res.data.shard_failure_response));
|
||||
}
|
||||
|
||||
const stats = _.get(res, 'data.fields', {});
|
||||
|
||||
return _.map(fields, (field) => {
|
||||
|
|
Loading…
Reference in a new issue