Skip to content

Commit 3a89d29

Browse files
committed
nits on doc
1 parent 979b113 commit 3a89d29

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

x-pack/plugins/global_search/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ or dashboards from the Kibana instance, from both server and client-side plugins
66
## Consuming the globalSearch API
77

88
```ts
9-
startDeps.globalSearch.find('some term').subscribe(
10-
({ results }) => {
9+
startDeps.globalSearch.find('some term').subscribe({
10+
next: ({ results }) => {
1111
addNewResultsToList(results);
1212
},
13-
() => {},
14-
() => {
13+
error: () => {},
14+
complete: () => {
1515
showAsyncSearchIndicator(false);
1616
}
17-
);
17+
});
1818
```
1919

2020
## Registering custom result providers
@@ -39,6 +39,8 @@ Results from providers registered from the client-side `registerResultProvider`
3939
not be available when performing a search from the server-side. For this reason, prefer
4040
registering providers using the server-side API when possible.
4141
42+
Refer to the [RFC](rfcs/text/0011_global_search.md#result_provider_registration) for more details
43+
4244
### Search completion cause
4345
4446
There is currently no way to identify `globalSearch.find` observable completion cause:

x-pack/plugins/global_search/common/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const convertResultUrl = (
2222
): string => {
2323
if (typeof url === 'string') {
2424
// relative path
25-
if (url.indexOf('/') === 0) {
25+
if (url.startsWith('/')) {
2626
return basePath.prepend(url);
2727
}
2828
// absolute url

x-pack/plugins/global_search/public/services/search_service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ export interface SearchServiceStart {
5151
*
5252
* @example
5353
* ```ts
54-
* startDeps.globalSearch.find('some term').subscribe(
55-
* ({ results }) => {
54+
* startDeps.globalSearch.find('some term').subscribe({
55+
* next: ({ results }) => {
5656
* addNewResultsToList(results);
5757
* },
58-
* () => {},
59-
* () => {
58+
* error: () => {},
59+
* complete: () => {
6060
* showAsyncSearchIndicator(false);
6161
* }
62-
* );
62+
* });
6363
* ```
6464
*
6565
* @remarks

x-pack/plugins/global_search/server/services/search_service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ export interface SearchServiceStart {
4444
*
4545
* @example
4646
* ```ts
47-
* startDeps.globalSearch.find('some term').subscribe(
48-
* ({ results }) => {
47+
* startDeps.globalSearch.find('some term').subscribe({
48+
* next: ({ results }) => {
4949
* addNewResultsToList(results);
50-
* },
51-
* () => {},
52-
* () => {
50+
* },
51+
* error: () => {},
52+
* complete: () => {
5353
* showAsyncSearchIndicator(false);
5454
* }
55-
* );
55+
* });
5656
* ```
5757
*
5858
* @remarks

0 commit comments

Comments
 (0)