mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Search] Generic search request and response types (#78268)
* Improve search types to support EQL strategy * doc * Update types.ts * update demo strategy Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
38f517ae9f
commit
0e1796acc5
40 changed files with 152 additions and 240 deletions
|
@ -7,7 +7,7 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest<ISearchRequestParams>
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
@ -15,5 +15,4 @@ export interface IEsSearchRequest extends IKibanaSearchRequest
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [indexType](./kibana-plugin-plugins-data-public.iessearchrequest.indextype.md) | <code>string</code> | |
|
||||
| [params](./kibana-plugin-plugins-data-public.iessearchrequest.params.md) | <code>ISearchRequestParams</code> | |
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) > [params](./kibana-plugin-plugins-data-public.iessearchrequest.params.md)
|
||||
|
||||
## IEsSearchRequest.params property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
params?: ISearchRequestParams;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) > [isRunning](./kibana-plugin-plugins-data-public.iessearchresponse.isrunning.md)
|
||||
|
||||
## IEsSearchResponse.isRunning property
|
||||
|
||||
Indicates whether async search is still in flight
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isRunning?: boolean;
|
||||
```
|
|
@ -2,19 +2,10 @@
|
|||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md)
|
||||
|
||||
## IEsSearchResponse interface
|
||||
## IEsSearchResponse type
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface IEsSearchResponse<Source = any> extends IKibanaSearchResponse
|
||||
export declare type IEsSearchResponse<Source = any> = IKibanaSearchResponse<SearchResponse<Source>>;
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [isPartial](./kibana-plugin-plugins-data-public.iessearchresponse.ispartial.md) | <code>boolean</code> | Indicates whether the results returned are complete or partial |
|
||||
| [isRunning](./kibana-plugin-plugins-data-public.iessearchresponse.isrunning.md) | <code>boolean</code> | Indicates whether async search is still in flight |
|
||||
| [rawResponse](./kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md) | <code>SearchResponse<Source></code> | |
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) > [rawResponse](./kibana-plugin-plugins-data-public.iessearchresponse.rawresponse.md)
|
||||
|
||||
## IEsSearchResponse.rawResponse property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
rawResponse: SearchResponse<Source>;
|
||||
```
|
|
@ -7,13 +7,13 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface IKibanaSearchRequest
|
||||
export interface IKibanaSearchRequest<Params = any>
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [debug](./kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md) | <code>boolean</code> | Optionally tell search strategies to output debug information. |
|
||||
| [id](./kibana-plugin-plugins-data-public.ikibanasearchrequest.id.md) | <code>string</code> | An id can be used to uniquely identify this request. |
|
||||
| [params](./kibana-plugin-plugins-data-public.ikibanasearchrequest.params.md) | <code>Params</code> | |
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchRequest](./kibana-plugin-plugins-data-public.ikibanasearchrequest.md) > [debug](./kibana-plugin-plugins-data-public.ikibanasearchrequest.debug.md)
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchRequest](./kibana-plugin-plugins-data-public.ikibanasearchrequest.md) > [params](./kibana-plugin-plugins-data-public.ikibanasearchrequest.params.md)
|
||||
|
||||
## IKibanaSearchRequest.debug property
|
||||
|
||||
Optionally tell search strategies to output debug information.
|
||||
## IKibanaSearchRequest.params property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
debug?: boolean;
|
||||
params?: Params;
|
||||
```
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) > [isPartial](./kibana-plugin-plugins-data-public.iessearchresponse.ispartial.md)
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) > [isPartial](./kibana-plugin-plugins-data-public.ikibanasearchresponse.ispartial.md)
|
||||
|
||||
## IEsSearchResponse.isPartial property
|
||||
## IKibanaSearchResponse.isPartial property
|
||||
|
||||
Indicates whether the results returned are complete or partial
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) > [isRunning](./kibana-plugin-plugins-data-public.ikibanasearchresponse.isrunning.md)
|
||||
|
||||
## IKibanaSearchResponse.isRunning property
|
||||
|
||||
Indicates whether search is still in flight
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isRunning?: boolean;
|
||||
```
|
|
@ -7,7 +7,7 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface IKibanaSearchResponse
|
||||
export interface IKibanaSearchResponse<RawResponse = any>
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
@ -15,6 +15,9 @@ export interface IKibanaSearchResponse
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [id](./kibana-plugin-plugins-data-public.ikibanasearchresponse.id.md) | <code>string</code> | Some responses may contain a unique id to identify the request this response came from. |
|
||||
| [isPartial](./kibana-plugin-plugins-data-public.ikibanasearchresponse.ispartial.md) | <code>boolean</code> | Indicates whether the results returned are complete or partial |
|
||||
| [isRunning](./kibana-plugin-plugins-data-public.ikibanasearchresponse.isrunning.md) | <code>boolean</code> | Indicates whether search is still in flight |
|
||||
| [loaded](./kibana-plugin-plugins-data-public.ikibanasearchresponse.loaded.md) | <code>number</code> | If relevant to the search strategy, return a loaded number that represents how progress is indicated. |
|
||||
| [rawResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.rawresponse.md) | <code>RawResponse</code> | |
|
||||
| [total](./kibana-plugin-plugins-data-public.ikibanasearchresponse.total.md) | <code>number</code> | If relevant to the search strategy, return a total number that represents how progress is indicated. |
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IKibanaSearchResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.md) > [rawResponse](./kibana-plugin-plugins-data-public.ikibanasearchresponse.rawresponse.md)
|
||||
|
||||
## IKibanaSearchResponse.rawResponse property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
rawResponse: RawResponse;
|
||||
```
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isCompleteResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined
|
||||
isCompleteResponse: (response?: IKibanaSearchResponse<any> | undefined) => boolean | undefined
|
||||
```
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ISearchGeneric = <SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>(request: SearchStrategyRequest, options?: ISearchOptions) => Observable<SearchStrategyResponse>;
|
||||
export declare type ISearchGeneric = <SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>(request: SearchStrategyRequest, options?: ISearchOptions) => Observable<SearchStrategyResponse>;
|
||||
```
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isErrorResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined
|
||||
isErrorResponse: (response?: IKibanaSearchResponse<any> | undefined) => boolean | undefined
|
||||
```
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isPartialResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined
|
||||
isPartialResponse: (response?: IKibanaSearchResponse<any> | undefined) => boolean | undefined
|
||||
```
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
| [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) | |
|
||||
| [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) | |
|
||||
| [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) | |
|
||||
| [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) | |
|
||||
| [IFieldSubType](./kibana-plugin-plugins-data-public.ifieldsubtype.md) | |
|
||||
| [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) | |
|
||||
| [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) | |
|
||||
|
@ -152,6 +151,7 @@
|
|||
| [Filter](./kibana-plugin-plugins-data-public.filter.md) | |
|
||||
| [IAggConfig](./kibana-plugin-plugins-data-public.iaggconfig.md) | AggConfig This class represents an aggregation, which is displayed in the left-hand nav of the Visualize app. |
|
||||
| [IAggType](./kibana-plugin-plugins-data-public.iaggtype.md) | |
|
||||
| [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) | |
|
||||
| [IFieldFormat](./kibana-plugin-plugins-data-public.ifieldformat.md) | |
|
||||
| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-public.ifieldformatsregistry.md) | |
|
||||
| [IFieldParamType](./kibana-plugin-plugins-data-public.ifieldparamtype.md) | |
|
||||
|
|
|
@ -9,7 +9,7 @@ Searches using the given `search` method. Overrides the `AbortSignal` with one t
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
search(request: IEsSearchRequest, options?: ISearchOptions): Observable<IEsSearchResponse>;
|
||||
search(request: IEsSearchRequest, options?: ISearchOptions): Observable<IKibanaSearchResponse>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
@ -21,5 +21,5 @@ search(request: IEsSearchRequest, options?: ISearchOptions): Observable<IEsSearc
|
|||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Observable<IEsSearchResponse>`
|
||||
`Observable<IKibanaSearchResponse>`
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest<ISearchRequestParams>
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
@ -15,5 +15,4 @@ export interface IEsSearchRequest extends IKibanaSearchRequest
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [indexType](./kibana-plugin-plugins-data-server.iessearchrequest.indextype.md) | <code>string</code> | |
|
||||
| [params](./kibana-plugin-plugins-data-server.iessearchrequest.params.md) | <code>ISearchRequestParams</code> | |
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IEsSearchRequest](./kibana-plugin-plugins-data-server.iessearchrequest.md) > [params](./kibana-plugin-plugins-data-server.iessearchrequest.params.md)
|
||||
|
||||
## IEsSearchRequest.params property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
params?: ISearchRequestParams;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-server.iessearchresponse.md) > [isPartial](./kibana-plugin-plugins-data-server.iessearchresponse.ispartial.md)
|
||||
|
||||
## IEsSearchResponse.isPartial property
|
||||
|
||||
Indicates whether the results returned are complete or partial
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isPartial?: boolean;
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-server.iessearchresponse.md) > [isRunning](./kibana-plugin-plugins-data-server.iessearchresponse.isrunning.md)
|
||||
|
||||
## IEsSearchResponse.isRunning property
|
||||
|
||||
Indicates whether async search is still in flight
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isRunning?: boolean;
|
||||
```
|
|
@ -2,19 +2,10 @@
|
|||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-server.iessearchresponse.md)
|
||||
|
||||
## IEsSearchResponse interface
|
||||
## IEsSearchResponse type
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface IEsSearchResponse<Source = any> extends IKibanaSearchResponse
|
||||
export declare type IEsSearchResponse<Source = any> = IKibanaSearchResponse<SearchResponse<Source>>;
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [isPartial](./kibana-plugin-plugins-data-server.iessearchresponse.ispartial.md) | <code>boolean</code> | Indicates whether the results returned are complete or partial |
|
||||
| [isRunning](./kibana-plugin-plugins-data-server.iessearchresponse.isrunning.md) | <code>boolean</code> | Indicates whether async search is still in flight |
|
||||
| [rawResponse](./kibana-plugin-plugins-data-server.iessearchresponse.rawresponse.md) | <code>SearchResponse<Source></code> | |
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IEsSearchResponse](./kibana-plugin-plugins-data-server.iessearchresponse.md) > [rawResponse](./kibana-plugin-plugins-data-server.iessearchresponse.rawresponse.md)
|
||||
|
||||
## IEsSearchResponse.rawResponse property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
rawResponse: SearchResponse<Source>;
|
||||
```
|
|
@ -15,6 +15,6 @@ export interface ISearchSetup
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [aggs](./kibana-plugin-plugins-data-server.isearchsetup.aggs.md) | <code>AggsSetup</code> | |
|
||||
| [registerSearchStrategy](./kibana-plugin-plugins-data-server.isearchsetup.registersearchstrategy.md) | <code><SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>(name: string, strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>) => void</code> | Extension point exposed for other plugins to register their own search strategies. |
|
||||
| [registerSearchStrategy](./kibana-plugin-plugins-data-server.isearchsetup.registersearchstrategy.md) | <code><SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>(name: string, strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>) => void</code> | Extension point exposed for other plugins to register their own search strategies. |
|
||||
| [usage](./kibana-plugin-plugins-data-server.isearchsetup.usage.md) | <code>SearchUsage</code> | Used internally for telemetry |
|
||||
|
||||
|
|
|
@ -9,5 +9,5 @@ Extension point exposed for other plugins to register their own search strategie
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
registerSearchStrategy: <SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>(name: string, strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>) => void;
|
||||
registerSearchStrategy: <SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>(name: string, strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>) => void;
|
||||
```
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface ISearchStart<SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>
|
||||
export interface ISearchStart<SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
@ -16,5 +16,5 @@ export interface ISearchStart<SearchStrategyRequest extends IEsSearchRequest = I
|
|||
| --- | --- | --- |
|
||||
| [aggs](./kibana-plugin-plugins-data-server.isearchstart.aggs.md) | <code>AggsStart</code> | |
|
||||
| [getSearchStrategy](./kibana-plugin-plugins-data-server.isearchstart.getsearchstrategy.md) | <code>(name: string) => ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse></code> | Get other registered search strategies. For example, if a new strategy needs to use the already-registered ES search strategy, it can use this function to accomplish that. |
|
||||
| [search](./kibana-plugin-plugins-data-server.isearchstart.search.md) | <code>(context: RequestHandlerContext, request: IEsSearchRequest, options: ISearchOptions) => Promise<IEsSearchResponse></code> | |
|
||||
| [search](./kibana-plugin-plugins-data-server.isearchstart.search.md) | <code>(context: RequestHandlerContext, request: SearchStrategyRequest, options: ISearchOptions) => Promise<SearchStrategyResponse></code> | |
|
||||
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
search: (context: RequestHandlerContext, request: IEsSearchRequest, options: ISearchOptions) => Promise<IEsSearchResponse>;
|
||||
search: (context: RequestHandlerContext, request: SearchStrategyRequest, options: ISearchOptions) => Promise<SearchStrategyResponse>;
|
||||
```
|
||||
|
|
|
@ -9,7 +9,7 @@ Search strategy interface contains a search method that takes in a request and r
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface ISearchStrategy<SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>
|
||||
export interface ISearchStrategy<SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
| [FieldDescriptor](./kibana-plugin-plugins-data-server.fielddescriptor.md) | |
|
||||
| [FieldFormatConfig](./kibana-plugin-plugins-data-server.fieldformatconfig.md) | |
|
||||
| [IEsSearchRequest](./kibana-plugin-plugins-data-server.iessearchrequest.md) | |
|
||||
| [IEsSearchResponse](./kibana-plugin-plugins-data-server.iessearchresponse.md) | |
|
||||
| [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) | |
|
||||
| [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) | |
|
||||
| [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) | |
|
||||
|
@ -92,6 +91,7 @@
|
|||
| [Filter](./kibana-plugin-plugins-data-server.filter.md) | |
|
||||
| [IAggConfig](./kibana-plugin-plugins-data-server.iaggconfig.md) | AggConfig This class represents an aggregation, which is displayed in the left-hand nav of the Visualize app. |
|
||||
| [IAggType](./kibana-plugin-plugins-data-server.iaggtype.md) | |
|
||||
| [IEsSearchResponse](./kibana-plugin-plugins-data-server.iessearchresponse.md) | |
|
||||
| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) | |
|
||||
| [IFieldParamType](./kibana-plugin-plugins-data-server.ifieldparamtype.md) | |
|
||||
| [IMetricAggType](./kibana-plugin-plugins-data-server.imetricaggtype.md) | |
|
||||
|
|
|
@ -20,15 +20,16 @@
|
|||
import { ISearchStrategy, PluginStart } from '../../../src/plugins/data/server';
|
||||
import { IMyStrategyResponse, IMyStrategyRequest } from '../common';
|
||||
|
||||
export const mySearchStrategyProvider = (data: PluginStart): ISearchStrategy => {
|
||||
export const mySearchStrategyProvider = (
|
||||
data: PluginStart
|
||||
): ISearchStrategy<IMyStrategyRequest, IMyStrategyResponse> => {
|
||||
const es = data.search.getSearchStrategy('es');
|
||||
return {
|
||||
search: async (context, request, options): Promise<IMyStrategyResponse> => {
|
||||
request.debug = true;
|
||||
search: async (context, request, options) => {
|
||||
const esSearchRes = await es.search(context, request, options);
|
||||
return {
|
||||
...esSearchRes,
|
||||
cool: (request as IMyStrategyRequest).get_cool ? 'YES' : 'NOPE',
|
||||
cool: request.get_cool ? 'YES' : 'NOPE',
|
||||
};
|
||||
},
|
||||
cancel: async (context, id) => {
|
||||
|
|
|
@ -37,22 +37,8 @@ export type ISearchRequestParams<T = Record<string, any>> = {
|
|||
trackTotalHits?: boolean;
|
||||
} & Search<T>;
|
||||
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest {
|
||||
params?: ISearchRequestParams;
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest<ISearchRequestParams> {
|
||||
indexType?: string;
|
||||
}
|
||||
|
||||
export interface IEsSearchResponse<Source = any> extends IKibanaSearchResponse {
|
||||
/**
|
||||
* Indicates whether async search is still in flight
|
||||
*/
|
||||
isRunning?: boolean;
|
||||
/**
|
||||
* Indicates whether the results returned are complete or partial
|
||||
*/
|
||||
isPartial?: boolean;
|
||||
rawResponse: SearchResponse<Source>;
|
||||
}
|
||||
|
||||
export const isEsResponse = (response: any): response is IEsSearchResponse =>
|
||||
response && response.rawResponse;
|
||||
export type IEsSearchResponse<Source = any> = IKibanaSearchResponse<SearchResponse<Source>>;
|
||||
|
|
|
@ -17,25 +17,25 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { IEsSearchResponse } from './types';
|
||||
import { IKibanaSearchResponse } from '..';
|
||||
|
||||
/**
|
||||
* @returns true if response had an error while executing in ES
|
||||
*/
|
||||
export const isErrorResponse = (response?: IEsSearchResponse) => {
|
||||
export const isErrorResponse = (response?: IKibanaSearchResponse) => {
|
||||
return !response || (!response.isRunning && response.isPartial);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns true if response is completed successfully
|
||||
*/
|
||||
export const isCompleteResponse = (response?: IEsSearchResponse) => {
|
||||
export const isCompleteResponse = (response?: IKibanaSearchResponse) => {
|
||||
return response && !response.isRunning && !response.isPartial;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns true if request is still running an/d response contains partial results
|
||||
*/
|
||||
export const isPartialResponse = (response?: IEsSearchResponse) => {
|
||||
export const isPartialResponse = (response?: IKibanaSearchResponse) => {
|
||||
return response && response.isRunning && response.isPartial;
|
||||
};
|
||||
|
|
|
@ -23,4 +23,3 @@ export * from './expressions';
|
|||
export * from './search_source';
|
||||
export * from './tabify';
|
||||
export * from './types';
|
||||
export * from './es_search';
|
||||
|
|
|
@ -26,14 +26,14 @@ export type ISearch = (
|
|||
) => Observable<IKibanaSearchResponse>;
|
||||
|
||||
export type ISearchGeneric = <
|
||||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
>(
|
||||
request: SearchStrategyRequest,
|
||||
options?: ISearchOptions
|
||||
) => Observable<SearchStrategyResponse>;
|
||||
|
||||
export interface IKibanaSearchResponse {
|
||||
export interface IKibanaSearchResponse<RawResponse = any> {
|
||||
/**
|
||||
* Some responses may contain a unique id to identify the request this response came from.
|
||||
*/
|
||||
|
@ -50,16 +50,25 @@ export interface IKibanaSearchResponse {
|
|||
* that represents how progress is indicated.
|
||||
*/
|
||||
loaded?: number;
|
||||
|
||||
/**
|
||||
* Indicates whether search is still in flight
|
||||
*/
|
||||
isRunning?: boolean;
|
||||
|
||||
/**
|
||||
* Indicates whether the results returned are complete or partial
|
||||
*/
|
||||
isPartial?: boolean;
|
||||
|
||||
rawResponse: RawResponse;
|
||||
}
|
||||
|
||||
export interface IKibanaSearchRequest {
|
||||
export interface IKibanaSearchRequest<Params = any> {
|
||||
/**
|
||||
* An id can be used to uniquely identify this request.
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Optionally tell search strategies to output debug information.
|
||||
*/
|
||||
debug?: boolean;
|
||||
params?: Params;
|
||||
}
|
||||
|
|
|
@ -918,22 +918,15 @@ export interface IDataPluginServices extends Partial<CoreStart_2> {
|
|||
// Warning: (ae-missing-release-tag) "IEsSearchRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest {
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest<ISearchRequestParams> {
|
||||
// (undocumented)
|
||||
indexType?: string;
|
||||
// (undocumented)
|
||||
params?: ISearchRequestParams;
|
||||
}
|
||||
|
||||
// Warning: (ae-missing-release-tag) "IEsSearchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface IEsSearchResponse<Source = any> extends IKibanaSearchResponse {
|
||||
isPartial?: boolean;
|
||||
isRunning?: boolean;
|
||||
// (undocumented)
|
||||
rawResponse: SearchResponse<Source>;
|
||||
}
|
||||
export type IEsSearchResponse<Source = any> = IKibanaSearchResponse<SearchResponse<Source>>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "IFieldFormat" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
@ -1062,17 +1055,22 @@ export interface IIndexPatternFieldList extends Array<IndexPatternField> {
|
|||
// Warning: (ae-missing-release-tag) "IKibanaSearchRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface IKibanaSearchRequest {
|
||||
debug?: boolean;
|
||||
export interface IKibanaSearchRequest<Params = any> {
|
||||
id?: string;
|
||||
// (undocumented)
|
||||
params?: Params;
|
||||
}
|
||||
|
||||
// Warning: (ae-missing-release-tag) "IKibanaSearchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface IKibanaSearchResponse {
|
||||
export interface IKibanaSearchResponse<RawResponse = any> {
|
||||
id?: string;
|
||||
isPartial?: boolean;
|
||||
isRunning?: boolean;
|
||||
loaded?: number;
|
||||
// (undocumented)
|
||||
rawResponse: RawResponse;
|
||||
total?: number;
|
||||
}
|
||||
|
||||
|
@ -1420,7 +1418,7 @@ export type InputTimeRange = TimeRange | {
|
|||
// Warning: (ae-missing-release-tag) "isCompleteResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const isCompleteResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined;
|
||||
export const isCompleteResponse: (response?: IKibanaSearchResponse<any> | undefined) => boolean | undefined;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ISearch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
@ -1430,7 +1428,7 @@ export type ISearch = (request: IKibanaSearchRequest, options?: ISearchOptions)
|
|||
// Warning: (ae-missing-release-tag) "ISearchGeneric" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type ISearchGeneric = <SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>(request: SearchStrategyRequest, options?: ISearchOptions) => Observable<SearchStrategyResponse>;
|
||||
export type ISearchGeneric = <SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>(request: SearchStrategyRequest, options?: ISearchOptions) => Observable<SearchStrategyResponse>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ISearchOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
@ -1477,7 +1475,7 @@ export interface ISearchStartSearchSource {
|
|||
// Warning: (ae-missing-release-tag) "isErrorResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const isErrorResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined;
|
||||
export const isErrorResponse: (response?: IKibanaSearchResponse<any> | undefined) => boolean | undefined;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "isFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
@ -1492,7 +1490,7 @@ export const isFilters: (x: unknown) => x is Filter[];
|
|||
// Warning: (ae-missing-release-tag) "isPartialResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const isPartialResponse: (response?: IEsSearchResponse<any> | undefined) => boolean | undefined;
|
||||
export const isPartialResponse: (response?: IKibanaSearchResponse<any> | undefined) => boolean | undefined;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "isQuery" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
@ -2030,8 +2028,8 @@ export class SearchInterceptor {
|
|||
// @internal
|
||||
protected pendingCount$: BehaviorSubject<number>;
|
||||
// @internal (undocumented)
|
||||
protected runSearch(request: IEsSearchRequest, signal: AbortSignal, strategy?: string): Observable<IEsSearchResponse>;
|
||||
search(request: IEsSearchRequest, options?: ISearchOptions): Observable<IEsSearchResponse>;
|
||||
protected runSearch(request: IEsSearchRequest, signal: AbortSignal, strategy?: string): Observable<IKibanaSearchResponse>;
|
||||
search(request: IEsSearchRequest, options?: ISearchOptions): Observable<IKibanaSearchResponse>;
|
||||
// @internal (undocumented)
|
||||
protected setupAbortSignal({ abortSignal, timeout, }: {
|
||||
abortSignal?: AbortSignal;
|
||||
|
|
|
@ -35,7 +35,7 @@ import {
|
|||
getCombinedSignal,
|
||||
AbortError,
|
||||
IEsSearchRequest,
|
||||
IEsSearchResponse,
|
||||
IKibanaSearchResponse,
|
||||
ISearchOptions,
|
||||
ES_SEARCH_STRATEGY,
|
||||
} from '../../common';
|
||||
|
@ -91,7 +91,7 @@ export class SearchInterceptor {
|
|||
request: IEsSearchRequest,
|
||||
signal: AbortSignal,
|
||||
strategy?: string
|
||||
): Observable<IEsSearchResponse> {
|
||||
): Observable<IKibanaSearchResponse> {
|
||||
const { id, ...searchRequest } = request;
|
||||
const path = trimEnd(`/internal/search/${strategy || ES_SEARCH_STRATEGY}/${id || ''}`, '/');
|
||||
const body = JSON.stringify(searchRequest);
|
||||
|
@ -113,7 +113,7 @@ export class SearchInterceptor {
|
|||
public search(
|
||||
request: IEsSearchRequest,
|
||||
options?: ISearchOptions
|
||||
): Observable<IEsSearchResponse> {
|
||||
): Observable<IKibanaSearchResponse> {
|
||||
// Defer the following logic until `subscribe` is actually called
|
||||
return defer(() => {
|
||||
if (options?.abortSignal?.aborted) {
|
||||
|
|
|
@ -22,7 +22,6 @@ import { IRouter } from 'src/core/server';
|
|||
import { getRequestAbortedSignal } from '../../lib';
|
||||
import { SearchRouteDependencies } from '../search_service';
|
||||
import { shimHitsTotal } from './shim_hits_total';
|
||||
import { isEsResponse } from '../../../common';
|
||||
|
||||
export function registerSearchRoute(
|
||||
router: IRouter,
|
||||
|
@ -62,11 +61,9 @@ export function registerSearchRoute(
|
|||
return res.ok({
|
||||
body: {
|
||||
...response,
|
||||
...(isEsResponse(response)
|
||||
? {
|
||||
rawResponse: shimHitsTotal(response.rawResponse),
|
||||
}
|
||||
: {}),
|
||||
...{
|
||||
rawResponse: shimHitsTotal(response.rawResponse),
|
||||
},
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
|
|
|
@ -40,12 +40,15 @@ import { UsageCollectionSetup } from '../../../usage_collection/server';
|
|||
import { registerUsageCollector } from './collectors/register';
|
||||
import { usageProvider } from './collectors/usage';
|
||||
import { searchTelemetry } from '../saved_objects';
|
||||
import { IEsSearchRequest, IEsSearchResponse, ISearchOptions } from '../../common';
|
||||
import {
|
||||
IKibanaSearchRequest,
|
||||
IKibanaSearchResponse,
|
||||
IEsSearchRequest,
|
||||
IEsSearchResponse,
|
||||
ISearchOptions,
|
||||
} from '../../common';
|
||||
|
||||
type StrategyMap<
|
||||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse
|
||||
> = Record<string, ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>>;
|
||||
type StrategyMap = Record<string, ISearchStrategy<any, any>>;
|
||||
|
||||
/** @internal */
|
||||
export interface SearchServiceSetupDependencies {
|
||||
|
@ -67,7 +70,7 @@ export interface SearchRouteDependencies {
|
|||
export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
|
||||
private readonly aggsService = new AggsService();
|
||||
private defaultSearchStrategyName: string = ES_SEARCH_STRATEGY;
|
||||
private searchStrategies: StrategyMap<any, any> = {};
|
||||
private searchStrategies: StrategyMap = {};
|
||||
|
||||
constructor(
|
||||
private initializerContext: PluginInitializerContext,
|
||||
|
@ -113,19 +116,6 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
|
|||
usage,
|
||||
};
|
||||
}
|
||||
|
||||
private search(
|
||||
context: RequestHandlerContext,
|
||||
searchRequest: IEsSearchRequest,
|
||||
options: ISearchOptions
|
||||
) {
|
||||
return this.getSearchStrategy(options.strategy || this.defaultSearchStrategyName).search(
|
||||
context,
|
||||
searchRequest,
|
||||
options
|
||||
);
|
||||
}
|
||||
|
||||
public start(
|
||||
{ uiSettings }: CoreStart,
|
||||
{ fieldFormats }: SearchServiceStartDependencies
|
||||
|
@ -135,7 +125,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
|
|||
getSearchStrategy: this.getSearchStrategy,
|
||||
search: (
|
||||
context: RequestHandlerContext,
|
||||
searchRequest: IEsSearchRequest,
|
||||
searchRequest: IKibanaSearchRequest,
|
||||
options: Record<string, any>
|
||||
) => {
|
||||
return this.search(context, searchRequest, options);
|
||||
|
@ -148,8 +138,8 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
|
|||
}
|
||||
|
||||
private registerSearchStrategy = <
|
||||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
>(
|
||||
name: string,
|
||||
strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>
|
||||
|
@ -158,7 +148,25 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
|
|||
this.searchStrategies[name] = strategy;
|
||||
};
|
||||
|
||||
private getSearchStrategy = (name: string): ISearchStrategy => {
|
||||
private search = <
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
>(
|
||||
context: RequestHandlerContext,
|
||||
searchRequest: SearchStrategyRequest,
|
||||
options: ISearchOptions
|
||||
): Promise<SearchStrategyResponse> => {
|
||||
return this.getSearchStrategy<SearchStrategyRequest, SearchStrategyResponse>(
|
||||
options.strategy || this.defaultSearchStrategyName
|
||||
).search(context, searchRequest, options);
|
||||
};
|
||||
|
||||
private getSearchStrategy = <
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
>(
|
||||
name: string
|
||||
): ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse> => {
|
||||
this.logger.debug(`Get strategy ${name}`);
|
||||
const strategy = this.searchStrategies[name];
|
||||
if (!strategy) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
import { RequestHandlerContext } from '../../../../core/server';
|
||||
import { ISearchOptions } from '../../common/search';
|
||||
import { ISearchOptions, IKibanaSearchRequest, IKibanaSearchResponse } from '../../common/search';
|
||||
import { AggsSetup, AggsStart } from './aggs';
|
||||
import { SearchUsage } from './collectors';
|
||||
import { IEsSearchRequest, IEsSearchResponse } from './es_search';
|
||||
|
@ -34,8 +34,8 @@ export interface ISearchSetup {
|
|||
* strategies.
|
||||
*/
|
||||
registerSearchStrategy: <
|
||||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
>(
|
||||
name: string,
|
||||
strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>
|
||||
|
@ -53,8 +53,8 @@ export interface ISearchSetup {
|
|||
}
|
||||
|
||||
export interface ISearchStart<
|
||||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
> {
|
||||
aggs: AggsStart;
|
||||
/**
|
||||
|
@ -66,9 +66,9 @@ export interface ISearchStart<
|
|||
) => ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>;
|
||||
search: (
|
||||
context: RequestHandlerContext,
|
||||
request: IEsSearchRequest,
|
||||
request: SearchStrategyRequest,
|
||||
options: ISearchOptions
|
||||
) => Promise<IEsSearchResponse>;
|
||||
) => Promise<SearchStrategyResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,8 +76,8 @@ export interface ISearchStart<
|
|||
* that resolves to a response.
|
||||
*/
|
||||
export interface ISearchStrategy<
|
||||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse
|
||||
SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest,
|
||||
SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse
|
||||
> {
|
||||
search: (
|
||||
context: RequestHandlerContext,
|
||||
|
|
|
@ -527,28 +527,20 @@ export type IAggConfigs = AggConfigs;
|
|||
export type IAggType = AggType;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "IKibanaSearchRequest" needs to be exported by the entry point index.d.ts
|
||||
// Warning: (ae-forgotten-export) The symbol "ISearchRequestParams" needs to be exported by the entry point index.d.ts
|
||||
// Warning: (ae-missing-release-tag) "IEsSearchRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest {
|
||||
export interface IEsSearchRequest extends IKibanaSearchRequest<ISearchRequestParams> {
|
||||
// (undocumented)
|
||||
indexType?: string;
|
||||
// Warning: (ae-forgotten-export) The symbol "ISearchRequestParams" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
params?: ISearchRequestParams;
|
||||
}
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "IKibanaSearchResponse" needs to be exported by the entry point index.d.ts
|
||||
// Warning: (ae-missing-release-tag) "IEsSearchResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface IEsSearchResponse<Source = any> extends IKibanaSearchResponse {
|
||||
isPartial?: boolean;
|
||||
isRunning?: boolean;
|
||||
// (undocumented)
|
||||
rawResponse: SearchResponse<Source>;
|
||||
}
|
||||
export type IEsSearchResponse<Source = any> = IKibanaSearchResponse<SearchResponse<Source>>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "IFieldFormatsRegistry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
|
@ -824,14 +816,14 @@ export interface ISearchSetup {
|
|||
//
|
||||
// (undocumented)
|
||||
aggs: AggsSetup;
|
||||
registerSearchStrategy: <SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse>(name: string, strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>) => void;
|
||||
registerSearchStrategy: <SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse>(name: string, strategy: ISearchStrategy<SearchStrategyRequest, SearchStrategyResponse>) => void;
|
||||
usage?: SearchUsage;
|
||||
}
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ISearchStart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export interface ISearchStart<SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse> {
|
||||
export interface ISearchStart<SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse> {
|
||||
// Warning: (ae-forgotten-export) The symbol "AggsStart" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
|
@ -840,13 +832,13 @@ export interface ISearchStart<SearchStrategyRequest extends IEsSearchRequest = I
|
|||
// Warning: (ae-forgotten-export) The symbol "RequestHandlerContext" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
search: (context: RequestHandlerContext, request: IEsSearchRequest, options: ISearchOptions) => Promise<IEsSearchResponse>;
|
||||
search: (context: RequestHandlerContext, request: SearchStrategyRequest, options: ISearchOptions) => Promise<SearchStrategyResponse>;
|
||||
}
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ISearchStrategy" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public
|
||||
export interface ISearchStrategy<SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse> {
|
||||
export interface ISearchStrategy<SearchStrategyRequest extends IKibanaSearchRequest = IEsSearchRequest, SearchStrategyResponse extends IKibanaSearchResponse = IEsSearchResponse> {
|
||||
// (undocumented)
|
||||
cancel?: (context: RequestHandlerContext, id: string) => Promise<void>;
|
||||
// (undocumented)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue