Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/kibana/components/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define(function () {
description: 'The index to access if no index is set',
},
'metaFields': {
value: ['_source', '_id', '_type', '_index'],
value: ['_source', '_id', '_type', '_index', '_score'],
description: 'Fields that exist outside of _source to merge into our document when displaying it',
},
'discover:sampleSize': {
Expand Down
2 changes: 1 addition & 1 deletion src/kibana/components/doc_table/doc_table.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ doc-table {
z-index: 20;
opacity: @loading-opacity;
}
}
}
6 changes: 3 additions & 3 deletions src/kibana/components/index_patterns/_cast_mapping_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ define(function (require) {
* @return {String} - the most specific type that we care for
*/
function castMappingType(name) {
var match = castMappingType.types.byName[name];
if (!name) return 'unknown';

if (match) return match.type;
return 'string';
var match = castMappingType.types.byName[name];
return match ? match.type : 'string';
}

return castMappingType;
Expand Down
3 changes: 1 addition & 2 deletions src/kibana/components/index_patterns/_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ define(function (require) {

var indexed = !!spec.indexed;
var scripted = !!spec.scripted;

var sortable = (indexed || scripted) && type.sortable;
var sortable = spec.name === '_score' || ((indexed || scripted) && type.sortable);
var bucketable = indexed || scripted;
var filterable = spec.name === '_id' || scripted || (indexed && type.filterable);

Expand Down
14 changes: 9 additions & 5 deletions src/kibana/components/index_patterns/_map_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ define(function (require) {

// Override the mapping, even if elasticsearch says otherwise
var mappingOverrides = {
_timestamp: {
indexed: true,
type: 'date'
},
_source: { type: '_source' },
_index: { type: 'string' },
_type: { type: 'string' },
_id: { type: 'string' }
_id: { type: 'string' },
_timestamp: {
type: 'date',
indexed: true
},
_score: {
type: 'number',
indexed: false
}
};

if (!mapping.index || mapping.index === 'no') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ define(function (require) {
});
});

config.get('metaFields').forEach(function (meta) {
if (fields[meta]) return;

var field = { mapping: {} };
field.mapping[meta] = {};
fields[meta] = mapField(field, meta);
});

return _.map(fields, function (mapping, name) {
mapping.name = name;
return mapping;
Expand Down
1 change: 0 additions & 1 deletion src/kibana/plugins/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ define(function (require) {
}

$scope.updateTime();

segmented.setDirection(sortBy === 'time' ? (sort[1] || 'desc') : 'desc');
segmented.setSize(sortBy === 'time' ? $scope.opts.sampleSize : false);

Expand Down