diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md
index 37db063e284e..4c53af3f8970 100644
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md
+++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md
@@ -61,7 +61,5 @@ export declare class IndexPattern implements IIndexPattern
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | |
| [save(saveAttempts)](./kibana-plugin-plugins-data-public.indexpattern.save.md) | | |
-| [toJSON()](./kibana-plugin-plugins-data-public.indexpattern.tojson.md) | | |
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |
-| [toString()](./kibana-plugin-plugins-data-public.indexpattern.tostring.md) | | |
diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tojson.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tojson.md
deleted file mode 100644
index 0ae04bb424d4..000000000000
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tojson.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [toJSON](./kibana-plugin-plugins-data-public.indexpattern.tojson.md)
-
-## IndexPattern.toJSON() method
-
-Signature:
-
-```typescript
-toJSON(): string | undefined;
-```
-Returns:
-
-`string | undefined`
-
diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tostring.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tostring.md
deleted file mode 100644
index a10b549a7b9e..000000000000
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.tostring.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [toString](./kibana-plugin-plugins-data-public.indexpattern.tostring.md)
-
-## IndexPattern.toString() method
-
-Signature:
-
-```typescript
-toString(): string;
-```
-Returns:
-
-`string`
-
diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts
index 2350cbb67683..f037a71b508a 100644
--- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts
+++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts
@@ -151,8 +151,6 @@ describe('IndexPattern', () => {
expect(indexPattern).toHaveProperty('getNonScriptedFields');
expect(indexPattern).toHaveProperty('addScriptedField');
expect(indexPattern).toHaveProperty('removeScriptedField');
- expect(indexPattern).toHaveProperty('toString');
- expect(indexPattern).toHaveProperty('toJSON');
expect(indexPattern).toHaveProperty('save');
// properties
diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts
index c82bf7d75932..2feeb5441ab8 100644
--- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts
+++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts
@@ -650,12 +650,4 @@ export class IndexPattern implements IIndexPattern {
});
});
}
-
- toJSON() {
- return this.id;
- }
-
- toString() {
- return '' + this.toJSON();
- }
}
diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md
index b09e957944b6..e72fea160cc2 100644
--- a/src/plugins/data/public/public.api.md
+++ b/src/plugins/data/public/public.api.md
@@ -1022,12 +1022,8 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
title: string;
// (undocumented)
- toJSON(): string | undefined;
- // (undocumented)
toSpec(): IndexPatternSpec;
// (undocumented)
- toString(): string;
- // (undocumented)
type: string | undefined;
// (undocumented)
typeMeta?: IndexPatternTypeMeta;
diff --git a/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx b/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx
index 16d9e0c5418f..1f2c97b128e3 100644
--- a/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx
+++ b/x-pack/plugins/ml/public/application/datavisualizer/index_based/components/actions_panel/actions_panel.tsx
@@ -13,6 +13,7 @@ import { EuiSpacer, EuiText, EuiTitle, EuiFlexGroup } from '@elastic/eui';
import { IndexPattern } from '../../../../../../../../../src/plugins/data/public';
import { CreateJobLinkCard } from '../../../../components/create_job_link_card';
import { DataRecognizer } from '../../../../components/data_recognizer';
+import { getBasePath } from '../../../../util/dependency_cache';
interface Props {
indexPattern: IndexPattern;
@@ -20,6 +21,7 @@ interface Props {
export const ActionsPanel: FC = ({ indexPattern }) => {
const [recognizerResultsCount, setRecognizerResultsCount] = useState(0);
+ const basePath = getBasePath();
const recognizerResults = {
count: 0,
@@ -31,7 +33,7 @@ export const ActionsPanel: FC = ({ indexPattern }) => {
function openAdvancedJobWizard() {
// TODO - pass the search string to the advanced job page as well as the index pattern
// (add in with new advanced job wizard?)
- window.open(`#/jobs/new_job/advanced?index=${indexPattern}`, '_self');
+ window.open(`${basePath.get()}/app/ml/jobs/new_job/advanced?index=${indexPattern.id}`, '_self');
}
// Note we use display:none for the DataRecognizer section as it needs to be
@@ -86,7 +88,7 @@ export const ActionsPanel: FC = ({ indexPattern }) => {
'Use the full range of options to create a job for more advanced use cases',
})}
onClick={openAdvancedJobWizard}
- href={`#/jobs/new_job/advanced?index=${indexPattern}`}
+ href={`${basePath.get()}/app/ml/jobs/new_job/advanced?index=${indexPattern.id}`}
data-test-subj="mlDataVisualizerCreateAdvancedJobCard"
/>