Skip to content

Commit

Permalink
Add default size for custom vector map
Browse files Browse the repository at this point in the history
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
  • Loading branch information
VijayanB committed Feb 9, 2023
1 parent d9dc91d commit 3300cbb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [VisBuilder] Fixes pipeline aggs ([#3137](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3137))
- [Region Maps] Fixes bug that prevents selected join field to be used ([#3213](Fix bug that prevents selected join field to be used))
- [Multi DataSource]Update test connection button text([#3247](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3247))
- [Region Maps] Add default size for custom vector map([#3399](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3399))

### 🚞 Infrastructure

Expand Down
1 change: 1 addition & 0 deletions src/plugins/region_map/common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

export const DEFAULT_MAP_CHOICE = 'default';
export const CUSTOM_MAP_CHOICE = 'custom';
export const DEFAULT_INDEX_FETCH_SIZE = 10000; // opensearch index.max_result_window default value
8 changes: 6 additions & 2 deletions src/plugins/region_map/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { DEFAULT_MAP_CHOICE, CUSTOM_MAP_CHOICE } from './constants/shared';
import {
DEFAULT_MAP_CHOICE,
CUSTOM_MAP_CHOICE,
DEFAULT_INDEX_FETCH_SIZE,
} from './constants/shared';

export { DEFAULT_MAP_CHOICE, CUSTOM_MAP_CHOICE };
export { DEFAULT_MAP_CHOICE, CUSTOM_MAP_CHOICE, DEFAULT_INDEX_FETCH_SIZE };
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import './map_choice_options.scss';
import React, { useCallback, useMemo, useState } from 'react';
import React, { useCallback, useMemo } from 'react';
import {
EuiPanel,
EuiSpacer,
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/region_map/server/routes/opensearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { schema } from '@osd/config-schema';
import { IRouter } from 'opensearch-dashboards/server';
import { DEFAULT_INDEX_FETCH_SIZE } from '../../common';

export function registerGeospatialRoutes(router: IRouter) {
router.post(
Expand Down Expand Up @@ -64,7 +65,7 @@ export function registerGeospatialRoutes(router: IRouter) {
const client = context.core.opensearch.client.asCurrentUser;
try {
const { index } = req.body;
const params = { index, body: {} };
const params = { index, body: {}, size: DEFAULT_INDEX_FETCH_SIZE };
const results = await client.search(params);
return res.ok({
body: {
Expand Down

0 comments on commit 3300cbb

Please sign in to comment.