[Maps] increase document limit from 2048 to 10000 (#39697) (#39862)

* [Maps] increase document limit from 2048 to 10000

* [Maps] increase document limit from 2048 to 10000

* rename DEFAULT_ES_DOC_LIMIT to ES_SIZE_LIMIT
This commit is contained in:
Nathan Reese 2019-06-27 18:38:31 -06:00 committed by GitHub
parent 780e047d21
commit 0052f07c23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View file

@ -15,6 +15,9 @@ See map.regionmap.* in <<settings>> for details.
*Documents*:: Geospatial data from a Kibana index pattern.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].
NOTE: Document results are limited to the first 10000 matching documents.
Use <<maps-aggregations, aggregations>> to plot large data sets.
*Grid aggregation*:: Geospatial data grouped in grids with metrics for each gridded cell.
Set *Show as* to *grid rectangles* or *points*.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point].

View file

@ -30,7 +30,7 @@ export const GEOJSON_FILE = 'GEOJSON_FILE';
export const DECIMAL_DEGREES_PRECISION = 5; // meters precision
export const ZOOM_PRECISION = 2;
export const DEFAULT_ES_DOC_LIMIT = 2048;
export const ES_SIZE_LIMIT = 10000;
export const FEATURE_ID_PROPERTY_NAME = '__kbn__feature_id__';

View file

@ -11,6 +11,7 @@ import { Schemas } from 'ui/vis/editors/default/schemas';
import { AggConfigs } from 'ui/vis/agg_configs';
import { i18n } from '@kbn/i18n';
import { ESTooltipProperty } from '../tooltips/es_tooltip_property';
import { ES_SIZE_LIMIT } from '../../../../common/constants';
const TERMS_AGG_NAME = 'join';
@ -175,7 +176,7 @@ export class ESJoinSource extends AbstractESSource {
schema: 'segment',
params: {
field: this._descriptor.term,
size: 10000
size: ES_SIZE_LIMIT
}
}
];

View file

@ -16,7 +16,7 @@ import { NoIndexPatternCallout } from '../../../components/no_index_pattern_call
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { kfetch } from 'ui/kfetch';
import { ES_GEO_FIELD_TYPE, GIS_API_PATH, DEFAULT_ES_DOC_LIMIT } from '../../../../../common/constants';
import { ES_GEO_FIELD_TYPE, GIS_API_PATH, ES_SIZE_LIMIT } from '../../../../../common/constants';
import { DEFAULT_FILTER_BY_MAP_BOUNDS } from './constants';
function filterGeoField(field) {
@ -89,7 +89,7 @@ export class CreateSourceEditor extends Component {
let indexHasSmallDocCount = false;
try {
const indexDocCount = await this.loadIndexDocCount(indexPattern.title);
indexHasSmallDocCount = indexDocCount <= DEFAULT_ES_DOC_LIMIT;
indexHasSmallDocCount = indexDocCount <= ES_SIZE_LIMIT;
} catch (error) {
// retrieving index count is a nice to have and is not essential
// do not interrupt user flow if unable to retrieve count

View file

@ -14,7 +14,7 @@ import { SearchSource } from '../../../../kibana_services';
import { hitsToGeoJson } from '../../../../elasticsearch_geo_utils';
import { CreateSourceEditor } from './create_source_editor';
import { UpdateSourceEditor } from './update_source_editor';
import { ES_SEARCH, ES_GEO_FIELD_TYPE, DEFAULT_ES_DOC_LIMIT } from '../../../../../common/constants';
import { ES_SEARCH, ES_GEO_FIELD_TYPE, ES_SIZE_LIMIT } from '../../../../../common/constants';
import { i18n } from '@kbn/i18n';
import { getDataSourceLabel } from '../../../../../common/i18n_getters';
import { ESTooltipProperty } from '../../tooltips/es_tooltip_property';
@ -162,7 +162,7 @@ export class ESSearchSource extends AbstractESSource {
entitySplit: {
terms: {
field: topHitsSplitField,
size: 10000
size: ES_SIZE_LIMIT
},
aggs: {
entityHits: {
@ -210,7 +210,7 @@ export class ESSearchSource extends AbstractESSource {
}
async _getSearchHits(layerName, searchFilters) {
const searchSource = await this._makeSearchSource(searchFilters, DEFAULT_ES_DOC_LIMIT);
const searchSource = await this._makeSearchSource(searchFilters, ES_SIZE_LIMIT);
// Setting "fields" instead of "source: { includes: []}"
// because SearchSource automatically adds the following by default
// 1) all scripted fields