-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Search] Server strategy example #71679
Merged
lizozom
merged 38 commits into
elastic:master
from
lizozom:search/server-strategy-example
Aug 11, 2020
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
cf412aa
Server strategy example
0f22458
Add tsconfig
b9a5efe
Docs + remove unused sample code
f7cd473
Fix test naming of arguments
f7f51c7
ts
170bae5
ts fix
47d7302
Add filters and query input selector
a84eafb
Update examples/search_examples/public/components/app.tsx
lizozom ee3ff70
Use new service
79f42e0
exapmle plugin ts
d4ec2ee
unsubscribe + use timefilter
b6c9cba
typo
e8ad12b
docs
1f87741
Merge branch 'master' of github.com:elastic/kibana into search/server…
c03f6a9
Add comments and use agg config
9068775
Added agg configs
0f546af
Adding getEsQuery to query service (??)
2614b3d
Merge branch 'master' of github.com:elastic/kibana into search/server…
93e1c55
Add server side example
b100cfe
docs
63e934a
Merge branch 'master' into search/server-strategy-example
elasticmachine f528d57
caps
0b1f36a
Merge branch 'search/server-strategy-example' of github.com:lizozom/k…
c451122
list plugin in examples page
cf06006
Merge branch 'master' of github.com:elastic/kibana into search/server…
48aead1
fix typo
e86823a
Merge branch 'master' of github.com:elastic/kibana into search/server…
f90a78d
Update examples/search_examples/public/application.tsx
lizozom d5f1976
Update examples/search_examples/public/application.tsx
lizozom b118ea0
Update examples/search_examples/public/components/app.tsx
lizozom 828ab62
Update examples/search_examples/public/components/app.tsx
lizozom b54f734
Update examples/search_examples/public/components/app.tsx
lizozom 5459bca
Merge branch 'master' into search/server-strategy-example
elasticmachine 741d8b3
Merge branch 'master' into search/server-strategy-example
elasticmachine 0a67c4f
eslint
1960c84
Merge branch 'master' of github.com:elastic/kibana into search/server…
9aebaae
Merge branch 'search/server-strategy-example' of github.com:lizozom/k…
dff19c8
Merge branch 'master' into search/server-strategy-example
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some thoughts: I wonder if it will be more common for custom strategies to extend
IKibanaSearchResponse
rather thanIEsSearchResponse
since they will likely be doing some sort of data manipulation and not sending the raw response back.