+ | ++ + + + + + + + + | -- - - - | -
diff --git a/src/kibana/components/courier/data_source/_abstract.js b/src/kibana/components/courier/data_source/_abstract.js index 148d714e7bee6..1af63f18e9cb8 100644 --- a/src/kibana/components/courier/data_source/_abstract.js +++ b/src/kibana/components/courier/data_source/_abstract.js @@ -264,16 +264,12 @@ define(function (require) { 'match_all': {} }; } - flatState.body.fields = ['*', '_source']; - _.each(flatState.index.fields.byType['date'], function (field) { - if (field.indexed) { - flatState.body.script_fields = flatState.body.script_fields || {}; - flatState.body.script_fields[field.name] = { - script: 'doc["' + field.name + '"].value' - }; - } - }); + var computedFields = flatState.index.getComputedFields(); + flatState.body.fields = computedFields.fields; + flatState.body.script_fields = flatState.body.script_fields || {}; + _.extend(flatState.body.script_fields, computedFields.scriptFields); + /** * Create a filter that can be reversed for filters with negate set diff --git a/src/kibana/components/doc_viewer/doc_viewer.html b/src/kibana/components/doc_viewer/doc_viewer.html index 7c91f0079ca66..c7b7e56a37c17 100644 --- a/src/kibana/components/doc_viewer/doc_viewer.html +++ b/src/kibana/components/doc_viewer/doc_viewer.html @@ -4,39 +4,41 @@
- | -- - - - - - - - - | +
+ | ++ + + + + + + + + | -- - - - | -
{{hit | json}}+
{{hit | json}}+ \ No newline at end of file diff --git a/src/kibana/components/doc_viewer/doc_viewer.less b/src/kibana/components/doc_viewer/doc_viewer.less index b3458d3d5e151..321d297bf31d5 100644 --- a/src/kibana/components/doc_viewer/doc_viewer.less +++ b/src/kibana/components/doc_viewer/doc_viewer.less @@ -14,4 +14,11 @@ doc-viewer .doc-viewer { white-space: pre-wrap; } + td, pre { + font-family: "Lucida Console", Monaco, monospace; + } + + .content { + margin-top: @padding-base-vertical; + } } \ No newline at end of file diff --git a/src/kibana/components/index_patterns/_get_computed_fields.js b/src/kibana/components/index_patterns/_get_computed_fields.js new file mode 100644 index 0000000000000..dda200fdbbb63 --- /dev/null +++ b/src/kibana/components/index_patterns/_get_computed_fields.js @@ -0,0 +1,23 @@ +// Takes a hit, merges it with any stored/scripted fields, and with the metaFields +// returns a flattened version +define(function (require) { + var _ = require('lodash'); + return function () { + var self = this; + var scriptFields = {}; + + _.each(self.fields.byType['date'], function (field) { + if (field.indexed) { + scriptFields[field.name] = { + script: 'doc["' + field.name + '"].value' + }; + } + }); + + return { + fields: ['*', '_source'], + scriptFields: scriptFields + }; + + }; +}); diff --git a/src/kibana/components/index_patterns/_index_pattern.js b/src/kibana/components/index_patterns/_index_pattern.js index 872f8e33c0758..66975b68a313b 100644 --- a/src/kibana/components/index_patterns/_index_pattern.js +++ b/src/kibana/components/index_patterns/_index_pattern.js @@ -12,6 +12,8 @@ define(function (require) { var DocSource = Private(require('components/courier/data_source/doc_source')); var flattenSearchResponse = require('components/index_patterns/_flatten_search_response'); var flattenHit = require('components/index_patterns/_flatten_hit'); + var getComputedFields = require('components/index_patterns/_get_computed_fields'); + var IndexedArray = require('utils/indexed_array/index'); @@ -224,6 +226,8 @@ define(function (require) { self.metaFields = config.get('metaFields'); self.flattenSearchResponse = flattenSearchResponse.bind(self); self.flattenHit = flattenHit.bind(self); + self.getComputedFields = getComputedFields.bind(self); + } return IndexPattern; diff --git a/src/kibana/plugins/discover/partials/table_row/details.html b/src/kibana/plugins/discover/partials/table_row/details.html index bef929434bbab..c3ab47ee219b8 100644 --- a/src/kibana/plugins/discover/partials/table_row/details.html +++ b/src/kibana/plugins/discover/partials/table_row/details.html @@ -1,3 +1,6 @@
+ Unfortunately I could not find any documents matching that id, of that type, in that index. I tried really hard. I wanted it to be there. Sometimes I swear documents grow legs and just walk out of the index. Sneaky. I wish I could offer some advice here, something to make you feel better +
+ ++ Oh no. Something went very wrong. Its not just that I couldn't find your document, I couldn't even try. The index was missing, or the type. Go check out Elasticsearch, something isn't quite right here. +
+ +