diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md
index cc3468531fffa..99d2fc00a6b7b 100644
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md
+++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md
@@ -9,7 +9,7 @@ Add scripted field to field list
Signature:
```typescript
-addScriptedField(name: string, script: string, fieldType?: string, lang?: string): Promise;
+addScriptedField(name: string, script: string, fieldType?: string): Promise;
```
## Parameters
@@ -19,7 +19,6 @@ addScriptedField(name: string, script: string, fieldType?: string, lang?: string
| name | string | |
| script | string | |
| fieldType | string | |
-| lang | string | |
Returns:
diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md
deleted file mode 100644
index 27f99f418a078..0000000000000
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.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) > [isTimeBasedWildcard](./kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md)
-
-## IndexPattern.isTimeBasedWildcard() method
-
-Signature:
-
-```typescript
-isTimeBasedWildcard(): boolean;
-```
-Returns:
-
-`boolean`
-
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 2ff575bc4fc22..325b97383e328 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
@@ -41,7 +41,7 @@ export declare class IndexPattern implements IIndexPattern
| Method | Modifiers | Description |
| --- | --- | --- |
-| [addScriptedField(name, script, fieldType, lang)](./kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md) | | Add scripted field to field list |
+| [addScriptedField(name, script, fieldType)](./kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md) | | Add scripted field to field list |
| [getAggregationRestrictions()](./kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md) | | |
| [getAsSavedObjectBody()](./kibana-plugin-plugins-data-public.indexpattern.getassavedobjectbody.md) | | Returns index pattern as saved object body for saving |
| [getComputedFields()](./kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md) | | |
@@ -52,7 +52,6 @@ export declare class IndexPattern implements IIndexPattern
| [getSourceFiltering()](./kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md) | | Get the source filtering configuration for that index. |
| [getTimeField()](./kibana-plugin-plugins-data-public.indexpattern.gettimefield.md) | | |
| [isTimeBased()](./kibana-plugin-plugins-data-public.indexpattern.istimebased.md) | | |
-| [isTimeBasedWildcard()](./kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md) | | |
| [isTimeNanosBased()](./kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md) | | |
| [popularizeField(fieldName, unit)](./kibana-plugin-plugins-data-public.indexpattern.popularizefield.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | Remove scripted field from field list |
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md
index 6d206e88b5b56..a86fea3106225 100644
--- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md
@@ -9,7 +9,7 @@ Add scripted field to field list
Signature:
```typescript
-addScriptedField(name: string, script: string, fieldType?: string, lang?: string): Promise;
+addScriptedField(name: string, script: string, fieldType?: string): Promise;
```
## Parameters
@@ -19,7 +19,6 @@ addScriptedField(name: string, script: string, fieldType?: string, lang?: string
| name | string | |
| script | string | |
| fieldType | string | |
-| lang | string | |
Returns:
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.istimebasedwildcard.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.istimebasedwildcard.md
deleted file mode 100644
index 7ef5e8318040a..0000000000000
--- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.istimebasedwildcard.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IndexPattern](./kibana-plugin-plugins-data-server.indexpattern.md) > [isTimeBasedWildcard](./kibana-plugin-plugins-data-server.indexpattern.istimebasedwildcard.md)
-
-## IndexPattern.isTimeBasedWildcard() method
-
-Signature:
-
-```typescript
-isTimeBasedWildcard(): boolean;
-```
-Returns:
-
-`boolean`
-
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md
index d877854444a09..e5a9e7d8f9f93 100644
--- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.md
@@ -41,7 +41,7 @@ export declare class IndexPattern implements IIndexPattern
| Method | Modifiers | Description |
| --- | --- | --- |
-| [addScriptedField(name, script, fieldType, lang)](./kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md) | | Add scripted field to field list |
+| [addScriptedField(name, script, fieldType)](./kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md) | | Add scripted field to field list |
| [getAggregationRestrictions()](./kibana-plugin-plugins-data-server.indexpattern.getaggregationrestrictions.md) | | |
| [getAsSavedObjectBody()](./kibana-plugin-plugins-data-server.indexpattern.getassavedobjectbody.md) | | Returns index pattern as saved object body for saving |
| [getComputedFields()](./kibana-plugin-plugins-data-server.indexpattern.getcomputedfields.md) | | |
@@ -52,7 +52,6 @@ export declare class IndexPattern implements IIndexPattern
| [getSourceFiltering()](./kibana-plugin-plugins-data-server.indexpattern.getsourcefiltering.md) | | Get the source filtering configuration for that index. |
| [getTimeField()](./kibana-plugin-plugins-data-server.indexpattern.gettimefield.md) | | |
| [isTimeBased()](./kibana-plugin-plugins-data-server.indexpattern.istimebased.md) | | |
-| [isTimeBasedWildcard()](./kibana-plugin-plugins-data-server.indexpattern.istimebasedwildcard.md) | | |
| [isTimeNanosBased()](./kibana-plugin-plugins-data-server.indexpattern.istimenanosbased.md) | | |
| [popularizeField(fieldName, unit)](./kibana-plugin-plugins-data-server.indexpattern.popularizefield.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md) | | Remove scripted field from field list |
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 91286a38f16a0..bfb5fd9da56e6 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
@@ -179,8 +179,7 @@ describe('IndexPattern', () => {
await indexPattern.addScriptedField(
scriptedField.name,
scriptedField.script,
- scriptedField.type,
- 'lang'
+ scriptedField.type
);
const scriptedFields = indexPattern.getScriptedFields();
@@ -206,7 +205,7 @@ describe('IndexPattern', () => {
const scriptedField = last(scriptedFields) as any;
expect.assertions(1);
try {
- await indexPattern.addScriptedField(scriptedField.name, "'new script'", 'string', 'lang');
+ await indexPattern.addScriptedField(scriptedField.name, "'new script'", 'string');
} catch (e) {
expect(e).toBeInstanceOf(DuplicateField);
}
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 882235889b55c..e880c3a9ff825 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
@@ -234,12 +234,7 @@ export class IndexPattern implements IIndexPattern {
* @param fieldType
* @param lang
*/
- async addScriptedField(
- name: string,
- script: string,
- fieldType: string = 'string',
- lang: string = 'painless'
- ) {
+ async addScriptedField(name: string, script: string, fieldType: string = 'string') {
const scriptedFields = this.getScriptedFields();
const names = _.map(scriptedFields, 'name');
@@ -252,7 +247,7 @@ export class IndexPattern implements IIndexPattern {
script,
type: fieldType,
scripted: true,
- lang,
+ lang: 'painless',
aggregatable: true,
searchable: true,
count: 0,
@@ -322,13 +317,9 @@ export class IndexPattern implements IIndexPattern {
return timeField && timeField.esTypes && timeField.esTypes.indexOf('date_nanos') !== -1;
}
- isTimeBasedWildcard(): boolean {
- return this.isTimeBased() && this.isWildcard();
- }
-
getTimeField() {
if (!this.timeFieldName || !this.fields || !this.fields.getByName) return undefined;
- return this.fields.getByName(this.timeFieldName) || undefined;
+ return this.fields.getByName(this.timeFieldName);
}
getFieldByName(name: string): IndexPatternField | undefined {
@@ -340,13 +331,6 @@ export class IndexPattern implements IIndexPattern {
return this.typeMeta?.aggs;
}
- /**
- * Does this index pattern title include a '*'
- */
- private isWildcard() {
- return _.includes(this.title, '*');
- }
-
/**
* Returns index pattern as saved object body for saving
*/
diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md
index 6b419f6995447..9c059c0f35892 100644
--- a/src/plugins/data/public/public.api.md
+++ b/src/plugins/data/public/public.api.md
@@ -1086,7 +1086,7 @@ export type IMetricAggType = MetricAggType;
export class IndexPattern implements IIndexPattern {
// Warning: (ae-forgotten-export) The symbol "IndexPatternDeps" needs to be exported by the entry point index.d.ts
constructor({ spec, savedObjectsClient, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps);
- addScriptedField(name: string, script: string, fieldType?: string, lang?: string): Promise;
+ addScriptedField(name: string, script: string, fieldType?: string): Promise;
// (undocumented)
fieldFormatMap: Record;
// (undocumented)
@@ -1159,8 +1159,6 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
isTimeBased(): boolean;
// (undocumented)
- isTimeBasedWildcard(): boolean;
- // (undocumented)
isTimeNanosBased(): boolean;
// (undocumented)
metaFields: string[];
diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md
index 9cf7234c4a9ff..eefc373559afb 100644
--- a/src/plugins/data/server/server.api.md
+++ b/src/plugins/data/server/server.api.md
@@ -624,7 +624,7 @@ export type IMetricAggType = MetricAggType;
export class IndexPattern implements IIndexPattern {
// Warning: (ae-forgotten-export) The symbol "IndexPatternDeps" needs to be exported by the entry point index.d.ts
constructor({ spec, savedObjectsClient, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps);
- addScriptedField(name: string, script: string, fieldType?: string, lang?: string): Promise;
+ addScriptedField(name: string, script: string, fieldType?: string): Promise;
// (undocumented)
fieldFormatMap: Record;
// Warning: (ae-forgotten-export) The symbol "IIndexPatternFieldList" needs to be exported by the entry point index.d.ts
@@ -701,8 +701,6 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
isTimeBased(): boolean;
// (undocumented)
- isTimeBasedWildcard(): boolean;
- // (undocumented)
isTimeNanosBased(): boolean;
// (undocumented)
metaFields: string[];