Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data.search] Simplify poll logic and improve types #82545

Merged
merged 37 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
26c47bd
[Search] Add request context and asScoped pattern
lukasolson Oct 15, 2020
36b8fcb
Update docs
lukasolson Oct 15, 2020
8274226
Merge branch 'master' into search-as-scoped
lukasolson Oct 16, 2020
c7296f0
Unify interface for getting search client
lukasolson Oct 19, 2020
9dadfb2
Update examples/search_examples/server/my_strategy.ts
lukasolson Oct 20, 2020
ab55bcb
Merge branch 'master' into search-as-scoped
lukasolson Oct 26, 2020
2b3d2a0
Review feedback
lukasolson Oct 26, 2020
7a048a0
Merge branch 'search-as-scoped' of github.com:lukasolson/kibana into …
lukasolson Oct 26, 2020
2d0da67
Merge branch 'master' into search-as-scoped
lukasolson Oct 27, 2020
f7cb5a1
Merge branch 'master' into search-as-scoped
lukasolson Oct 28, 2020
6c9aec5
Fix checks
lukasolson Oct 28, 2020
1ae55ef
Fix CI
lukasolson Oct 29, 2020
4634fb4
Fix security search
lukasolson Oct 29, 2020
c35fb49
Merge branch 'master' into search-as-scoped
lukasolson Oct 30, 2020
1567995
Merge branch 'master' into search-as-scoped
lukasolson Nov 2, 2020
5f7c9ab
Fix test
lukasolson Nov 2, 2020
f1b515d
Fix test for reals
lukasolson Nov 2, 2020
b0860e7
Merge branch 'master' into search-as-scoped
lukasolson Nov 3, 2020
11517ee
Fix types
lukasolson Nov 3, 2020
b1e06b0
[data.search] Refactor search polling and improve types
lukasolson Nov 3, 2020
8e8eae8
Merge branch 'master' into search-poll
lukasolson Nov 4, 2020
5f41a97
Merge branch 'master' of github.com:elastic/kibana into pr/82545
Nov 10, 2020
8e72dce
Merge branch 'master' into search-poll
lukasolson Nov 19, 2020
cf2b31d
Fix & update tests & types
lukasolson Nov 20, 2020
10a2f92
Merge branch 'master' into search-poll
kibanamachine Nov 21, 2020
01e8a06
eql totals
Nov 22, 2020
7874b18
doc
Nov 22, 2020
07d6b72
Revert "eql totals"
Nov 22, 2020
9ee668b
Merge branch 'master' of github.com:elastic/kibana into pr/82545
Nov 22, 2020
b61ebc3
lint
Nov 22, 2020
98c2c47
response type
Nov 22, 2020
09eaaac
Merge branch 'master' of github.com:elastic/kibana into pr/82545
Nov 24, 2020
2ba358f
shim inside strategies
Nov 24, 2020
1ad2f0b
shim for security
Nov 24, 2020
d4ef755
Merge branch 'master' of github.com:elastic/kibana into pr/82545
Nov 24, 2020
168214b
fix eql params
Nov 24, 2020
1c14a36
Merge branch 'master' of github.com:elastic/kibana into pr/82545
Nov 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ Constructs a new instance of the `PainlessError` class
<b>Signature:</b>

```typescript
constructor(err: IEsError, request: IKibanaSearchRequest);
constructor(err: IEsError);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| err | <code>IEsError</code> | |
| request | <code>IKibanaSearchRequest</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare class PainlessError extends EsError

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(err, request)](./kibana-plugin-plugins-data-public.painlesserror._constructor_.md) | | Constructs a new instance of the <code>PainlessError</code> class |
| [(constructor)(err)](./kibana-plugin-plugins-data-public.painlesserror._constructor_.md) | | Constructs a new instance of the <code>PainlessError</code> class |

## Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
<b>Signature:</b>

```typescript
protected handleSearchError(e: any, request: IKibanaSearchRequest, timeoutSignal: AbortSignal, options?: ISearchOptions): Error;
protected handleSearchError(e: any, timeoutSignal: AbortSignal, options?: ISearchOptions): Error;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| e | <code>any</code> | |
| request | <code>IKibanaSearchRequest</code> | |
| timeoutSignal | <code>AbortSignal</code> | |
| options | <code>ISearchOptions</code> | |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export declare class SearchInterceptor
| Method | Modifiers | Description |
| --- | --- | --- |
| [getTimeoutMode()](./kibana-plugin-plugins-data-public.searchinterceptor.gettimeoutmode.md) | | |
| [handleSearchError(e, request, timeoutSignal, options)](./kibana-plugin-plugins-data-public.searchinterceptor.handlesearcherror.md) | | |
| [handleSearchError(e, timeoutSignal, options)](./kibana-plugin-plugins-data-public.searchinterceptor.handlesearcherror.md) | | |
| [search(request, options)](./kibana-plugin-plugins-data-public.searchinterceptor.search.md) | | Searches using the given <code>search</code> method. Overrides the <code>AbortSignal</code> with one that will abort either when <code>cancelPending</code> is called, when the request times out, or when the original <code>AbortSignal</code> is aborted. Updates <code>pendingCount$</code> when the request is started/finalized. |
| [showError(e)](./kibana-plugin-plugins-data-public.searchinterceptor.showerror.md) | | |

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
<b>Signature:</b>

```typescript
export declare function getDefaultSearchParams(uiSettingsClient: IUiSettingsClient): Promise<{
maxConcurrentShardRequests: number | undefined;
ignoreUnavailable: boolean;
trackTotalHits: boolean;
}>;
export declare function getDefaultSearchParams(uiSettingsClient: IUiSettingsClient): Promise<Pick<Search, 'max_concurrent_shard_requests' | 'ignore_unavailable' | 'track_total_hits'>>;
```

## Parameters
Expand All @@ -22,9 +18,5 @@ export declare function getDefaultSearchParams(uiSettingsClient: IUiSettingsClie

<b>Returns:</b>

`Promise<{
maxConcurrentShardRequests: number | undefined;
ignoreUnavailable: boolean;
trackTotalHits: boolean;
}>`
`Promise<Pick<Search, 'max_concurrent_shard_requests' | 'ignore_unavailable' | 'track_total_hits'>>`

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
<b>Signature:</b>

```typescript
export declare function getShardTimeout(config: SharedGlobalConfig): {
timeout: string;
} | {
timeout?: undefined;
};
export declare function getShardTimeout(config: SharedGlobalConfig): Pick<Search, 'timeout'>;
```

## Parameters
Expand All @@ -22,9 +18,5 @@ export declare function getShardTimeout(config: SharedGlobalConfig): {

<b>Returns:</b>

`{
timeout: string;
} | {
timeout?: undefined;
}`
`Pick<Search, 'timeout'>`

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
| [getTime(indexPattern, timeRange, options)](./kibana-plugin-plugins-data-server.gettime.md) | |
| [parseInterval(interval)](./kibana-plugin-plugins-data-server.parseinterval.md) | |
| [plugin(initializerContext)](./kibana-plugin-plugins-data-server.plugin.md) | Static code to be shared externally |
| [searchUsageObserver(logger, usage)](./kibana-plugin-plugins-data-server.searchusageobserver.md) | Rxjs observer for easily doing <code>tap(searchUsageObserver(logger, usage))</code> in an rxjs chain. |
| [shouldReadFieldFromDocValues(aggregatable, esType)](./kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md) | |
| [usageProvider(core)](./kibana-plugin-plugins-data-server.usageprovider.md) | |

Expand All @@ -45,7 +46,6 @@
| [EsQueryConfig](./kibana-plugin-plugins-data-server.esqueryconfig.md) | |
| [FieldDescriptor](./kibana-plugin-plugins-data-server.fielddescriptor.md) | |
| [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) | |
| [IEsRawSearchResponse](./kibana-plugin-plugins-data-server.iesrawsearchresponse.md) | |
| [IEsSearchRequest](./kibana-plugin-plugins-data-server.iessearchrequest.md) | |
| [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) | |
| [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,6 @@

```typescript
search: {
esSearch: {
utils: {
doSearch: <SearchResponse = any>(searchMethod: () => Promise<SearchResponse>, abortSignal?: AbortSignal | undefined) => import("rxjs").Observable<SearchResponse>;
shimAbortSignal: <T extends import("../common").TransportRequestPromise<unknown>>(promise: T, signal: AbortSignal | undefined) => T;
trackSearchStatus: <KibanaResponse extends import("../common").IKibanaSearchResponse<any> = import("./search").IEsSearchResponse<import("src/core/server").SearchResponse<unknown>>>(logger: import("src/core/server").Logger, usage?: import("./search").SearchUsage | undefined) => import("rxjs").UnaryFunction<import("rxjs").Observable<KibanaResponse>, import("rxjs").Observable<KibanaResponse>>;
includeTotalLoaded: () => import("rxjs").OperatorFunction<import("../common").IKibanaSearchResponse<import("elasticsearch").SearchResponse<unknown>>, {
total: number;
loaded: number;
id?: string | undefined;
isRunning?: boolean | undefined;
isPartial?: boolean | undefined;
rawResponse: import("elasticsearch").SearchResponse<unknown>;
}>;
toKibanaSearchResponse: <SearchResponse_1 extends import("../common").IEsRawSearchResponse<any> = import("../common").IEsRawSearchResponse<any>, KibanaResponse_1 extends import("../common").IKibanaSearchResponse<any> = import("../common").IKibanaSearchResponse<SearchResponse_1>>() => import("rxjs").OperatorFunction<import("@elastic/elasticsearch").ApiResponse<SearchResponse_1, import("@elastic/elasticsearch/lib/Transport").Context>, KibanaResponse_1>;
getTotalLoaded: typeof getTotalLoaded;
toSnakeCase: typeof toSnakeCase;
};
};
aggs: {
CidrMask: typeof CidrMask;
dateHistogramInterval: typeof dateHistogramInterval;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [searchUsageObserver](./kibana-plugin-plugins-data-server.searchusageobserver.md)

## searchUsageObserver() function

Rxjs observer for easily doing `tap(searchUsageObserver(logger, usage))` in an rxjs chain.

<b>Signature:</b>

```typescript
export declare function searchUsageObserver(logger: Logger, usage?: SearchUsage): {
next(response: IEsSearchResponse): void;
error(): void;
};
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| logger | <code>Logger</code> | |
| usage | <code>SearchUsage</code> | |

<b>Returns:</b>

`{
next(response: IEsSearchResponse): void;
error(): void;
}`

55 changes: 0 additions & 55 deletions src/plugins/data/common/search/es_search/es_search_rxjs_utils.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/plugins/data/common/search/es_search/get_total_loaded.test.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/plugins/data/common/search/es_search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@
*/

export * from './types';
export * from './utils';
export * from './es_search_rxjs_utils';
export * from './shim_abort_signal';
export * from './to_snake_case';
export * from './get_total_loaded';
64 changes: 0 additions & 64 deletions src/plugins/data/common/search/es_search/shim_abort_signal.test.ts

This file was deleted.

Loading