-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search] Server strategy example (#71679)
* Server strategy example * Add tsconfig Renamed is_partial to isPartial Added isPartial and isRunning to OSS response type * Docs + remove unused sample code * Fix test naming of arguments * ts * ts fix * Add filters and query input selector * Update examples/search_examples/public/components/app.tsx Co-authored-by: Lukas Olson <olson.lukas@gmail.com> * Use new service * exapmle plugin ts * unsubscribe + use timefilter * typo * docs * Add comments and use agg config * Added agg configs Added field selector Added a custom input param * Adding getEsQuery to query service (??) * Add server side example * docs * caps * list plugin in examples page * fix typo * Update examples/search_examples/public/application.tsx Co-authored-by: Lukas Olson <olson.lukas@gmail.com> * Update examples/search_examples/public/application.tsx Co-authored-by: Lukas Olson <olson.lukas@gmail.com> * Update examples/search_examples/public/components/app.tsx Co-authored-by: Lukas Olson <olson.lukas@gmail.com> * Update examples/search_examples/public/components/app.tsx Co-authored-by: Lukas Olson <olson.lukas@gmail.com> * Update examples/search_examples/public/components/app.tsx Co-authored-by: Lukas Olson <olson.lukas@gmail.com> * eslint Co-authored-by: Lukas Olson <olson.lukas@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
b0c217f
commit 8ca3604
Showing
49 changed files
with
1,161 additions
and
106 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...ns/data/public/kibana-plugin-plugins-data-public.iessearchresponse.ispartial.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) > [IEsSearchResponse](./kibana-plugin-plugins-data-public.iessearchresponse.md) > [isPartial](./kibana-plugin-plugins-data-public.iessearchresponse.ispartial.md) | ||
|
||
## IEsSearchResponse.isPartial property | ||
|
||
Indicates whether the results returned are complete or partial | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
isPartial?: boolean; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...ns/data/public/kibana-plugin-plugins-data-public.iessearchresponse.isrunning.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) > [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; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...lugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.strategy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) > [ISearchOptions](./kibana-plugin-plugins-data-public.isearchoptions.md) > [strategy](./kibana-plugin-plugins-data-public.isearchoptions.strategy.md) | ||
|
||
## ISearchOptions.strategy property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
strategy?: string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ins/data/server/kibana-plugin-plugins-data-server.iessearchrequest.indextype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- 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) > [indexType](./kibana-plugin-plugins-data-server.iessearchrequest.indextype.md) | ||
|
||
## IEsSearchRequest.indexType property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
indexType?: string; | ||
``` |
19 changes: 19 additions & 0 deletions
19
...pment/plugins/data/server/kibana-plugin-plugins-data-server.iessearchrequest.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- 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) | ||
|
||
## IEsSearchRequest interface | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IEsSearchRequest extends IKibanaSearchRequest | ||
``` | ||
## Properties | ||
| 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> | | | ||
11 changes: 11 additions & 0 deletions
11
...lugins/data/server/kibana-plugin-plugins-data-server.iessearchrequest.params.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- 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; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...ns/data/server/kibana-plugin-plugins-data-server.iessearchresponse.ispartial.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- 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; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...ns/data/server/kibana-plugin-plugins-data-server.iessearchresponse.isrunning.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- 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; | ||
``` |
20 changes: 20 additions & 0 deletions
20
...ment/plugins/data/server/kibana-plugin-plugins-data-server.iessearchresponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- 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) | ||
|
||
## IEsSearchResponse interface | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IEsSearchResponse extends IKibanaSearchResponse | ||
``` | ||
## 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<any></code> | | | ||
11 changes: 11 additions & 0 deletions
11
.../data/server/kibana-plugin-plugins-data-server.iessearchresponse.rawresponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- 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<any>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# search_examples | ||
|
||
> An awesome Kibana plugin | ||
--- | ||
|
||
## Development | ||
|
||
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { IEsSearchResponse, IEsSearchRequest } from '../../../src/plugins/data/common'; | ||
|
||
export const PLUGIN_ID = 'searchExamples'; | ||
export const PLUGIN_NAME = 'Search Examples'; | ||
|
||
export interface IMyStrategyRequest extends IEsSearchRequest { | ||
get_cool: boolean; | ||
} | ||
export interface IMyStrategyResponse extends IEsSearchResponse { | ||
cool: string; | ||
} | ||
|
||
export const SERVER_SEARCH_ROUTE_PATH = '/api/examples/search'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"id": "searchExamples", | ||
"version": "8.0.0", | ||
"server": true, | ||
"ui": true, | ||
"requiredPlugins": ["navigation", "data", "developerExamples"], | ||
"optionalPlugins": [], | ||
"requiredBundles": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { AppMountParameters, CoreStart } from '../../../src/core/public'; | ||
import { AppPluginStartDependencies } from './types'; | ||
import { SearchExamplesApp } from './components/app'; | ||
|
||
export const renderApp = ( | ||
{ notifications, savedObjects, http }: CoreStart, | ||
{ navigation, data }: AppPluginStartDependencies, | ||
{ appBasePath, element }: AppMountParameters | ||
) => { | ||
ReactDOM.render( | ||
<SearchExamplesApp | ||
basename={appBasePath} | ||
notifications={notifications} | ||
savedObjectsClient={savedObjects.client} | ||
navigation={navigation} | ||
data={data} | ||
http={http} | ||
/>, | ||
element | ||
); | ||
|
||
return () => ReactDOM.unmountComponentAtNode(element); | ||
}; |
Oops, something went wrong.