Cross-linking and menu registration

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2021-05-24 16:02:03 +02:00
parent 8ad667cd96
commit 2714bf9c79
4 changed files with 29 additions and 23 deletions
+12 -12
View File
@@ -11,16 +11,14 @@ Backstage ecosystem.
To get started, you should get familiar with these core concepts:
TODO: Link these like a real TOC
- Search Engines
- Query Translators
- Documents and Indices
- Collators
- Decorators
- The Scheduler
- The Search Page
- Search Context and Components
- [Search Engines](#search-engines)
- [Query Translators](#query-translators)
- [Documents and Indices](#documents-and-indices)
- [Collators](#collators)
- [Decorators](#decorators)
- [The Scheduler](#the-scheduler)
- [The Search Page](#the-search-page)
- [Search Context and Components](#search-context-and-components)
### Search Engines
@@ -91,7 +89,8 @@ your heart's content, the Search Plugin takes care of state management and other
search logic for you, but most of the layout of a search page lives in a search
page component defined in your Backstage App.
For an example of a simple search page, check [getting started](TODO)
For an example of a simple search page, check
[getting started](./getting-started.md#adding-search-to-the-frontend)
### Search Context and Components
@@ -106,7 +105,8 @@ search results can be displayed using the `<SearchResult />` component.
The `<SearchResult />` and `<SearchFilter />` components are special, in that
they themselves are extensible. For an example of how to extend these
components, [check this out](TODO).
components, check
[getting started](./getting-started.md#adding-search-to-the-frontend).
If you need even more customization, you can use the search context like any
other React context to create custom search components of your own.
+13 -11
View File
@@ -204,7 +204,7 @@ get passed to the backend.
```
If you have advanced filter needs, you can specify your own filter component
like this (although contributions are welcome):
like this (although new core filter contributions are welcome):
```tsx
import { useSearch, SearchFilter } from '@backstage/plugin-search';
@@ -251,9 +251,10 @@ an example:
### Backend
Backstage Search isn't a search engine itself, rather, it provides an interface
between your Backstage instance and a Search Engine of your choice. Currently,
we only support one, in-memory search Engine called Lunr. It can be instantiated
like this:
between your Backstage instance and a
[Search Engine](./concepts.md#search-engines) of your choice. Currently, we only
support one, in-memory search Engine called Lunr. It can be instantiated like
this:
```typescript
const searchEngine = new LunrSearchEngine({ logger });
@@ -261,9 +262,9 @@ const indexBuilder = new IndexBuilder({ logger, searchEngine });
```
Backstage Search can be used to power search of anything! Plugins like the
Catalog offer default "collators" which are responsible for providing documents
to be indexed. You can register any number of collators with the `IndexBuilder`
like this:
Catalog offer default [collators](./concepts.md#collators) which are responsible
for providing documents [to be indexed](./concepts.md#documents-and-indices).
You can register any number of collators with the `IndexBuilder` like this:
```typescript
const indexBuilder = new IndexBuilder({ logger, searchEngine });
@@ -281,10 +282,11 @@ indexBuilder.addCollator({
});
```
Backstage Search builds and maintains its index on a schedule. You can change
how often the indexes are rebuilt for a given type of document. You may want to
do this if your documents are updated more or less frequently. You can do so by
modifying its `defaultRefreshIntervalSeconds` value, like this:
Backstage Search builds and maintains its index
[on a schedule](./concepts.md#the-scheduler). You can change how often the
indexes are rebuilt for a given type of document. You may want to do this if
your documents are updated more or less frequently. You can do so by modifying
its `defaultRefreshIntervalSeconds` value, like this:
```typescript {3}
indexBuilder.addCollator({
+2
View File
@@ -75,6 +75,8 @@
"label": "Backstage Search",
"ids": [
"features/search/search-overview",
"features/search/getting-started",
"features/search/concepts",
"features/search/architecture"
]
},
+2
View File
@@ -58,6 +58,8 @@ nav:
- Backstage Search:
- Overview: 'features/search/README.md'
- Getting Started: 'features/search/getting-started.md'
- Concepts: 'features/search/concepts.md'
- Search Architecture: 'features/search/architecture.md'
- TechDocs:
- Overview: 'features/techdocs/README.md'