Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Sep 28, 2020
1 parent cb9cf82 commit ed7fdd9
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,6 @@

## IndexPattern.getNonScriptedFields() method

This function is just used by Discover and it's high likely to be removed in the near future It doesn't use the save function to skip the error message that's displayed when a user adds several columns in a higher frequency that the changes can be persisted to ES resulting in 409 errors

if (!this.id) return; const field = this.fields.getByName(fieldName); if (!field) { return;

const count = Math.max((field.count \|\| 0) + unit, 0); if (field.count === count) { return;

field.count = count;

try { const res = await this.savedObjectsClient.update( 'index-pattern', this.id, this.getAsSavedObjectBody(),

version: this.version,

); this.version = res.version; } catch (e) { // no need for an error message here

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export declare class IndexPattern implements IIndexPattern
| [getComputedFields()](./kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md) | | |
| [getFieldByName(name)](./kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md) | | |
| [getFormatterForField(field)](./kibana-plugin-plugins-data-public.indexpattern.getformatterforfield.md) | | Provide a field, get its formatter |
| [getNonScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md) | | This function is just used by Discover and it's high likely to be removed in the near future It doesn't use the save function to skip the error message that's displayed when a user adds several columns in a higher frequency that the changes can be persisted to ES resulting in 409 errors<!-- -->if (!this.id) return; const field = this.fields.getByName(fieldName); if (!field) { return;<!-- -->const count = Math.max((field.count \|\| 0) + unit, 0); if (field.count === count) { return;<!-- -->field.count = count;<!-- -->try { const res = await this.savedObjectsClient.update( 'index-pattern', this.id, this.getAsSavedObjectBody(),<!-- -->version: this.version,<!-- -->); this.version = res.version; } catch (e) { // no need for an error message here |
| [getNonScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md) | | |
| [getScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md) | | |
| [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) | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,6 @@

## IndexPattern.getNonScriptedFields() method

This function is just used by Discover and it's high likely to be removed in the near future It doesn't use the save function to skip the error message that's displayed when a user adds several columns in a higher frequency that the changes can be persisted to ES resulting in 409 errors

if (!this.id) return; const field = this.fields.getByName(fieldName); if (!field) { return;

const count = Math.max((field.count \|\| 0) + unit, 0); if (field.count === count) { return;

field.count = count;

try { const res = await this.savedObjectsClient.update( 'index-pattern', this.id, this.getAsSavedObjectBody(),

version: this.version,

); this.version = res.version; } catch (e) { // no need for an error message here

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export declare class IndexPattern implements IIndexPattern
| [getComputedFields()](./kibana-plugin-plugins-data-server.indexpattern.getcomputedfields.md) | | |
| [getFieldByName(name)](./kibana-plugin-plugins-data-server.indexpattern.getfieldbyname.md) | | |
| [getFormatterForField(field)](./kibana-plugin-plugins-data-server.indexpattern.getformatterforfield.md) | | Provide a field, get its formatter |
| [getNonScriptedFields()](./kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md) | | This function is just used by Discover and it's high likely to be removed in the near future It doesn't use the save function to skip the error message that's displayed when a user adds several columns in a higher frequency that the changes can be persisted to ES resulting in 409 errors<!-- -->if (!this.id) return; const field = this.fields.getByName(fieldName); if (!field) { return;<!-- -->const count = Math.max((field.count \|\| 0) + unit, 0); if (field.count === count) { return;<!-- -->field.count = count;<!-- -->try { const res = await this.savedObjectsClient.update( 'index-pattern', this.id, this.getAsSavedObjectBody(),<!-- -->version: this.version,<!-- -->); this.version = res.version; } catch (e) { // no need for an error message here |
| [getNonScriptedFields()](./kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md) | | |
| [getScriptedFields()](./kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md) | | |
| [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) | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,40 +269,6 @@ export class IndexPattern implements IIndexPattern {
}
}

// async popularizeField(fieldName: string, unit = 1) {
/**
* This function is just used by Discover and it's high likely to be removed in the near future
* It doesn't use the save function to skip the error message that's displayed when
* a user adds several columns in a higher frequency that the changes can be persisted to ES
* resulting in 409 errors
if (!this.id) return;
const field = this.fields.getByName(fieldName);
if (!field) {
return;
}
const count = Math.max((field.count || 0) + unit, 0);
if (field.count === count) {
return;
}
field.count = count;
try {
const res = await this.savedObjectsClient.update(
'index-pattern',
this.id,
this.getAsSavedObjectBody(),
{
version: this.version,
}
);
this.version = res.version;
} catch (e) {
// no need for an error message here
}
}
*/

getNonScriptedFields() {
return [...this.fields.getAll().filter((field) => !field.scripted)];
}
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,7 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
getFieldByName(name: string): IndexPatternField | undefined;
getFormatterForField(field: IndexPatternField | IndexPatternField['spec'] | IFieldType): FieldFormat;
// (undocumented)
getNonScriptedFields(): IndexPatternField[];
getOriginalSavedObjectBody: () => {
title?: string | undefined;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ export class IndexPattern implements IIndexPattern {
getFieldByName(name: string): IndexPatternField | undefined;
getFormatterForField(field: IndexPatternField | IndexPatternField['spec'] | IFieldType): FieldFormat;
// Warning: (ae-forgotten-export) The symbol "IndexPatternField" needs to be exported by the entry point index.d.ts
//
// (undocumented)
getNonScriptedFields(): IndexPatternField[];
getOriginalSavedObjectBody: () => {
title?: string | undefined;
Expand Down

0 comments on commit ed7fdd9

Please sign in to comment.