mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Maps] increase DEFAULT_MAX_BUCKETS_LIMIT to 65535 (#70313)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
a81d8b55ab
commit
0e7c3c7ff0
5 changed files with 17 additions and 11 deletions
|
@ -90,7 +90,7 @@ export const DECIMAL_DEGREES_PRECISION = 5; // meters precision
|
|||
export const ZOOM_PRECISION = 2;
|
||||
export const DEFAULT_MAX_RESULT_WINDOW = 10000;
|
||||
export const DEFAULT_MAX_INNER_RESULT_WINDOW = 100;
|
||||
export const DEFAULT_MAX_BUCKETS_LIMIT = 10000;
|
||||
export const DEFAULT_MAX_BUCKETS_LIMIT = 65535;
|
||||
|
||||
export const FEATURE_ID_PROPERTY_NAME = '__kbn__feature_id__';
|
||||
export const FEATURE_VISIBLE_PROPERTY_NAME = '__kbn_isvisibleduetojoin__';
|
||||
|
|
|
@ -17,6 +17,8 @@ import { TopTermPercentageField } from './top_term_percentage_field';
|
|||
import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property';
|
||||
import { ESAggTooltipProperty } from '../tooltips/es_agg_tooltip_property';
|
||||
|
||||
const TERMS_AGG_SHARD_SIZE = 5;
|
||||
|
||||
export interface IESAggField extends IField {
|
||||
getValueAggDsl(indexPattern: IndexPattern): unknown | null;
|
||||
getBucketCount(): number;
|
||||
|
@ -100,7 +102,7 @@ export class ESAggField implements IESAggField {
|
|||
|
||||
const field = getField(indexPattern, this.getRootName());
|
||||
const aggType = this.getAggType();
|
||||
const aggBody = aggType === AGG_TYPE.TERMS ? { size: 1, shard_size: 1 } : {};
|
||||
const aggBody = aggType === AGG_TYPE.TERMS ? { size: 1, shard_size: TERMS_AGG_SHARD_SIZE } : {};
|
||||
return {
|
||||
[aggType]: addFieldToDSL(aggBody, field),
|
||||
};
|
||||
|
@ -108,7 +110,7 @@ export class ESAggField implements IESAggField {
|
|||
|
||||
getBucketCount(): number {
|
||||
// terms aggregation increases the overall number of buckets per split bucket
|
||||
return this.getAggType() === AGG_TYPE.TERMS ? 1 : 0;
|
||||
return this.getAggType() === AGG_TYPE.TERMS ? TERMS_AGG_SHARD_SIZE : 0;
|
||||
}
|
||||
|
||||
supportsFieldMeta(): boolean {
|
||||
|
|
|
@ -161,6 +161,7 @@ export class ESGeoGridSource extends AbstractESAggSource {
|
|||
bounds: makeESBbox(bufferedExtent),
|
||||
field: this._descriptor.geoField,
|
||||
precision,
|
||||
size: DEFAULT_MAX_BUCKETS_LIMIT,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -245,6 +246,8 @@ export class ESGeoGridSource extends AbstractESAggSource {
|
|||
bounds: makeESBbox(bufferedExtent),
|
||||
field: this._descriptor.geoField,
|
||||
precision,
|
||||
size: DEFAULT_MAX_BUCKETS_LIMIT,
|
||||
shard_size: DEFAULT_MAX_BUCKETS_LIMIT,
|
||||
},
|
||||
aggs: {
|
||||
gridCentroid: {
|
||||
|
|
|
@ -400,8 +400,9 @@ export function getBoundingBoxGeometry(geometry) {
|
|||
export function formatEnvelopeAsPolygon({ maxLat, maxLon, minLat, minLon }) {
|
||||
// GeoJSON mandates that the outer polygon must be counterclockwise to avoid ambiguous polygons
|
||||
// when the shape crosses the dateline
|
||||
const left = minLon;
|
||||
const right = maxLon;
|
||||
const lonDelta = maxLon - minLon;
|
||||
const left = lonDelta > 360 ? -180 : minLon;
|
||||
const right = lonDelta > 360 ? 180 : maxLon;
|
||||
const top = clampToLatBounds(maxLat);
|
||||
const bottom = clampToLatBounds(minLat);
|
||||
const topLeft = [left, top];
|
||||
|
|
|
@ -421,7 +421,7 @@ describe('createExtentFilter', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not clamp longitudes to -180 to 180', () => {
|
||||
it('should clamp longitudes to -180 to 180 when lonitude wraps globe', () => {
|
||||
const mapExtent = {
|
||||
maxLat: 39,
|
||||
maxLon: 209,
|
||||
|
@ -436,11 +436,11 @@ describe('createExtentFilter', () => {
|
|||
shape: {
|
||||
coordinates: [
|
||||
[
|
||||
[-191, 39],
|
||||
[-191, 35],
|
||||
[209, 35],
|
||||
[209, 39],
|
||||
[-191, 39],
|
||||
[-180, 39],
|
||||
[-180, 35],
|
||||
[180, 35],
|
||||
[180, 39],
|
||||
[-180, 39],
|
||||
],
|
||||
],
|
||||
type: 'Polygon',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue