Merge branch 'master' of https://github.com/elastic/kibana into bug/8063/no-safari-crash

This commit is contained in:
Stacey-Gammon 2016-09-19 09:27:21 -04:00
commit 85786666a9
4 changed files with 22 additions and 4 deletions

View file

@ -175,7 +175,7 @@ describe('kibana cli', function () {
const expected = [
command,
`https://download.elastic.co/kibana/${command}/${command}-1234.zip`
`https://artifacts.elastic.co/download/kibana-plugins/${command}/${command}-1234.zip`
];
expect(settings.urls).to.eql(expected);

View file

@ -6,7 +6,7 @@ import { arch, platform } from 'os';
function generateUrls({ version, plugin }) {
return [
plugin,
`https://download.elastic.co/kibana/${plugin}/${plugin}-${version}.zip`
`https://artifacts.elastic.co/download/kibana-plugins/${plugin}/${plugin}-${version}.zip`
];
}

View file

@ -7,7 +7,7 @@ import SearchRequestProvider from '../fetch/request/search';
import SegmentedRequestProvider from '../fetch/request/segmented';
import SearchStrategyProvider from '../fetch/strategy/search';
export default function SearchSourceFactory(Promise, Private) {
export default function SearchSourceFactory(Promise, Private, config) {
let SourceAbstract = Private(AbstractDataSourceProvider);
let SearchRequest = Private(SearchRequestProvider);
let SegmentedRequest = Private(SegmentedRequestProvider);
@ -150,8 +150,19 @@ export default function SearchSourceFactory(Promise, Private) {
switch (key) {
case 'filter':
let verifiedFilters = val;
if (config.get('courier:ignoreFilterIfFieldNotInIndex')) {
if (!_.isArray(val)) val = [val];
verifiedFilters = val.filter(function (el) {
if ('meta' in el && 'index' in state) {
const field = state.index.fields.byName[el.meta.key];
if (!field) return false;
}
return true;
});
}
// user a shallow flatten to detect if val is an array, and pull the values out if it is
state.filters = _([ state.filters || [], val ])
state.filters = _([ state.filters || [], verifiedFilters ])
.flatten()
// Yo Dawg! I heard you needed to filter out your filters
.reject(function (filter) {

View file

@ -81,6 +81,13 @@ export default function defaultSettingsProvider() {
'elasticsearch. This setting attempts to prevent the list of segments from getting too long, which might ' +
'cause requests to take much longer to process'
},
'courier:ignoreFilterIfFieldNotInIndex': {
value: false,
description: 'This configuration enhances support for dashboards containing visualizations accessing dissimilar indexes. ' +
'When set to false, all filters are applied to all visualizations. ' +
'When set to true, filter(s) will be ignored for a visualization ' +
'when the visualization\'s index does not contain the filtering field.'
},
'fields:popularLimit': {
value: 10,
description: 'The top N most popular fields to show',