Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into np-move-layers-to…
Browse files Browse the repository at this point in the history
…-np-maps
  • Loading branch information
Aaron Caldwell committed Apr 6, 2020
2 parents 786e8af + 1e92dcf commit 90b4d50
Show file tree
Hide file tree
Showing 459 changed files with 21,597 additions and 17,301 deletions.
2 changes: 1 addition & 1 deletion .ci/Jenkinsfile_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ kibanaPipeline(timeoutMinutes: 180) {
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
]),
])
workers.base(name: 'coverage-worker', label: 'tests-l', ramDisk: false, bootstrapped: false) {
workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) {
kibanaPipeline.downloadCoverageArtifacts()
kibanaPipeline.bash(
'''
Expand Down
4 changes: 2 additions & 2 deletions .ci/Jenkinsfile_visual_baseline
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ kibanaPipeline(timeoutMinutes: 120) {
catchError {
parallel([
'oss-visualRegression': {
workers.ci(name: 'oss-visualRegression', label: 'linux && immutable', ramDisk: false) {
workers.ci(name: 'oss-visualRegression', size: 's', ramDisk: false) {
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1)
}
},
'xpack-visualRegression': {
workers.ci(name: 'xpack-visualRegression', label: 'linux && immutable', ramDisk: false) {
workers.ci(name: 'xpack-visualRegression', size: 's', ramDisk: false) {
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1)
}
},
Expand Down
2 changes: 1 addition & 1 deletion .ci/es-snapshots/Jenkinsfile_build_es
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def PROMOTE_WITHOUT_VERIFY = !!params.PROMOTE_WITHOUT_VERIFICATION
timeout(time: 120, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
node('linux && immutable') {
node(workers.label('s')) {
catchErrors {
def VERSION
def SNAPSHOT_ID
Expand Down
2 changes: 1 addition & 1 deletion .ci/es-snapshots/Jenkinsfile_verify_es
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ kibanaPipeline(timeoutMinutes: 120) {
}

def promoteSnapshot(snapshotVersion, snapshotId) {
node('linux && immutable') {
node(workers.label('s')) {
esSnapshots.promote(snapshotVersion, snapshotId)
}
}
17 changes: 17 additions & 0 deletions docs/management/managing-indices.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,23 @@ under the *Mapped fields* tab as follows:
[role="screenshot"]
image::images/management-index-templates-mappings.png[Mapped fields page]

Alternatively, you can click the *Load JSON* link and define the mapping as JSON:

[source,js]
----------------------------------
{
"properties": {
"geo": {
"properties": {
"coordinates": {
"type": "geo_point"
}
}
}
}
}
----------------------------------

You can create additional mapping configurations in the *Dynamic templates* and
*Advanced options* tabs. No additional mappings are required for this example.

Expand Down
Binary file modified docs/maps/images/top_hits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions docs/maps/maps-aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ You can add the following metric aggregations:

* *Sum.* The total value.

* *Top term.* The most common value.

* *Unique count.* The number of distinct values.

Use aggregated layers with document layers to show aggregated views when the map shows larger
Expand All @@ -37,14 +39,24 @@ image::maps/images/grid_to_docs.gif[]

The *Grid aggregation* source uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[GeoTile grid aggregation] to group your documents into grids. You can calculate metrics for each gridded cell.

You can symbolize grid aggregation metrics as:
Symbolize grid aggregation metrics as:

*Clusters*:: Creates a <<vector-layer, vector layer>> with a cluster symbol for each gridded cell.
The cluster location is the weighted centroid for all geo-points in the gridded cell.

*Grid rectangles*:: Creates a <<vector-layer, vector layer>> with a bounding box polygon for each gridded cell.

*Heat map*:: Creates a <<heatmap-layer, heat map layer>> that clusters the weighted centroids for each gridded cell.

*Clusters*:: Creates a <<vector-layer, vector layer>> with a cluster symbol for each gridded cell.
The cluster location is the weighted centroid for all geo-points in the gridded cell.
To enable grid aggregation:

. Click *Add layer*, then select the *Grid aggregation* source.

To enable a blended layer that dynamically shows clusters or documents:

. Click *Add layer*, then select the *Documents* source.
. Configure *Index pattern* and the *Geospatial field*. To enable clustering, the *Geospatial field* must be set to a field mapped as {ref}/geo-point.html[geo_point].
. In *Scaling*, select *Show clusters when results exceed 10000*.


[role="xpack"]
Expand All @@ -55,10 +67,11 @@ You can display the most relevant documents per entity, for example, the most re
To get this data, {es} first groups your data using a {ref}/search-aggregations-bucket-terms-aggregation.html[terms aggregation],
then accumulates the most relevant documents based on sort order for each entry using a {ref}/search-aggregations-metrics-top-hits-aggregation.html[top hits metric aggregation].

Top hits per entity is available for <<vector-layer, vector layers>> with *Documents* source.
To enable top hits:

. In *Sorting*, select the *Show documents per entity* checkbox.
. Click *Add layer* button and select *Documents* source.
. Configure *Index pattern* and *Geospatial field*.
. In *Scaling*, select *Show top hits per entity*.
. Set *Entity* to the field that identifies entities in your documents.
This field will be used in the terms aggregation to group your documents into entity buckets.
. Set *Documents per entity* to configure the maximum number of documents accumulated per entity.
Expand Down
11 changes: 8 additions & 3 deletions docs/maps/vector-style.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The `bytes` property value for each feature will fit on a linear scale from the

To ensure symbols are consistent as you pan, zoom, and filter the map, quantitative data driven styling uses {ref}/search-aggregations-metrics-extendedstats-aggregation.html[extended_stats aggregation] to retrieve statistical metadata. Extended_stats is not available for numeric property values from the <<maps-aggregations, metric aggregations>> count, sum, and unique count.

To configure extended_stats,click the gear icon image:maps/images/gear_icon.png[] to configure extended_stats. Set *Sigma* to a smaller value to minimize outliers by moving the range minimum and maximum closer to the average. Clear the *Calculate range from indices* checkbox to turn off the extended_stats aggregation request. The gear icon is not available for numeric property values from the <<maps-aggregations, metric aggregations>> count, sum, and unique count.
To configure extended_stats, click the gear icon image:maps/images/gear_icon.png[]. Set *Sigma* to a smaller value to minimize outliers by moving the range minimum and maximum closer to the average. Clear the *Calculate range from indices* checkbox to turn off the extended_stats aggregation request. The gear icon is not available for numeric property values from the <<maps-aggregations, metric aggregations>> count, sum, and unique count.

NOTE: When extended_stats is not used, symbols might be inconsistent as users pan, zoom, and filter the map. Without extended_stats, the range is calculated with data from the local layer. The range is re-calculated when layer data changes.

Expand All @@ -76,16 +76,21 @@ When the symbol range minimum and maximum are the same and there is no range:
[[maps-vector-style-qualitative-data-driven]]
==== Qualitative data driven styling

Qualitative data driven styling symbolizes non-numeric properties, such as strings and IP addresses, by category.
Qualitative data driven styling symbolizes properties, such as strings and IP addresses, by category.

Qualitative data driven styling is available for the following styling properties:

* *Icon*
* *Fill color*
* *Border color*
* *Label color*
* *Label border color*

Qualitative data driven styling uses a {ref}/search-aggregations-bucket-terms-aggregation.html[terms aggregation] to retrieve the top nine categories for the property. Feature values within the top categories are assigned a unique color. Feature values outside of the top categories are grouped into the *Other* category. A feature is assigned the *Other* category when the property value is undefined.
To ensure symbols are consistent as you pan, zoom, and filter the map, qualitative data driven styling uses a {ref}/search-aggregations-bucket-terms-aggregation.html[terms aggregation]. The term aggregation retrieves the top nine categories for the property. Feature values within the top categories are assigned a unique style. Feature values outside of the top categories are grouped into the *Other* category. A feature is assigned the *Other* category when the property value is undefined.

To configure the terms aggregation, click the gear icon image:maps/images/gear_icon.png[]. Clear the *Get categories from indice* checkbox to turn off the terms aggregation request.

NOTE: When the terms aggregation is not used, symbols might be inconsistent as users pan, zoom, and filter the map. Without terms aggregation, the top categories are calculated with data from the local layer. The top categories are re-calculated when layer data changes.

This image shows an example of quantitative data driven styling using the <<add-sample-data, Kibana sample web logs>> data set.
The `machine.os.keyword` property determines the color of each symbol based on category.
Expand Down
4 changes: 4 additions & 0 deletions src/core/server/http/http_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export function getServerOptions(config: HttpConfig, { configureTLS = true } = {
host: config.host,
port: config.port,
routes: {
cache: {
privacy: 'private',
otherwise: 'private, no-cache, no-store, must-revalidate',
},
cors: config.cors,
payload: {
maxBytes: config.maxPayload.getValueInBytes(),
Expand Down
32 changes: 32 additions & 0 deletions src/core/server/http/integration_tests/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,38 @@ describe('Options', () => {
});
});

describe('Cache-Control', () => {
it('does not allow responses to be cached by default', async () => {
const { server: innerServer, createRouter } = await server.setup(setupDeps);
const router = createRouter('/');

router.get({ path: '/', validate: false, options: {} }, (context, req, res) => res.ok());
await server.start();

await supertest(innerServer.listener)
.get('/')
.expect('Cache-Control', 'private, no-cache, no-store, must-revalidate');
});

it('allows individual responses override the default cache-control header', async () => {
const { server: innerServer, createRouter } = await server.setup(setupDeps);
const router = createRouter('/');

router.get({ path: '/', validate: false, options: {} }, (context, req, res) =>
res.ok({
headers: {
'Cache-Control': 'public, max-age=1200',
},
})
);
await server.start();

await supertest(innerServer.listener)
.get('/')
.expect('Cache-Control', 'public, max-age=1200');
});
});

describe('Handler', () => {
it("Doesn't expose error details if handler throws", async () => {
const { server: innerServer, createRouter } = await server.setup(setupDeps);
Expand Down
1 change: 0 additions & 1 deletion src/legacy/core_plugins/kibana/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default function(kibana) {
'plugins/kibana/discover/legacy',
'plugins/kibana/dev_tools',
'plugins/kibana/visualize/legacy',
'plugins/kibana/dashboard/legacy',
],
app: {
id: 'kibana',
Expand Down
6 changes: 5 additions & 1 deletion src/legacy/core_plugins/kibana/migrations/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
*/

import { get } from 'lodash';
import { migrations730 as dashboardMigrations730 } from '../public/dashboard/migrations';
import {
migrateMatchAllQuery,
migrations730 as dashboardMigrations730,
} from '../public/dashboard/migrations';

function migrateIndexPattern(doc) {
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');
Expand Down Expand Up @@ -60,6 +63,7 @@ function migrateIndexPattern(doc) {

export const migrations = {
dashboard: {
'6.7.2': migrateMatchAllQuery,
'7.0.0': doc => {
// Set new "references" attribute
doc.references = doc.references || [];
Expand Down

This file was deleted.

28 changes: 0 additions & 28 deletions src/legacy/core_plugins/kibana/public/dashboard/index.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/legacy/core_plugins/kibana/public/dashboard/legacy.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
*/

export { migrations730 } from './migrations_730';
export { migrateMatchAllQuery } from './migrate_match_all_query';
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { migrateMatchAllQuery } from './migrate_match_all_query';
import { SavedObjectMigrationContext, SavedObjectMigrationFn } from 'kibana/server';

const savedObjectMigrationContext = (null as unknown) as SavedObjectMigrationContext;

describe('migrate match_all query', () => {
test('should migrate obsolete match_all query', () => {
const migratedDoc = migrateMatchAllQuery(
{
attributes: {
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({
query: {
match_all: {},
},
}),
},
},
} as Parameters<SavedObjectMigrationFn>[0],
savedObjectMigrationContext
);

const migratedSearchSource = JSON.parse(
migratedDoc.attributes.kibanaSavedObjectMeta.searchSourceJSON
);

expect(migratedSearchSource).toEqual({
query: {
query: '',
language: 'kuery',
},
});
});
});
Loading

0 comments on commit 90b4d50

Please sign in to comment.