Added documentation about optional config

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2022-06-18 12:48:34 -05:00
committed by Fredrik Adelöw
parent b69dd94766
commit fe664999df
2 changed files with 29 additions and 1 deletions
@@ -14,3 +14,31 @@ other plugins.
See [Backstage documentation](https://backstage.io/docs/features/search/search-engines#postgres)
for details on how to setup Postgres based search for your Backstage instance.
## Optional Configuration
The following is an example of the optional configuration that can be applied when using Postgres as the search backend. Currently this is mostly for just the highlight feature:
```yaml
search:
pg:
highlightOptions:
useHighlight: true # Used to enable to disable the highlight feature. The default value is true
maxWord: 35 # Used to set the longest headlines to output. The default value is 35.
minWord: 15 # Used to set the shortest headlines to output. The default value is 15.
shortWord: 3 # Words of this length or less will be dropped at the start and end of a headline, unless they are query terms. The default value of three (3) eliminates common English articles.
highlightAll: false # If true the whole document will be used as the headline, ignoring the preceding three parameters. The default is false.
maxFragments: 0 # Maximum number of text fragments to display. The default value of zero selects a non-fragment-based headline generation method. A value greater than zero selects fragment-based headline generation (see the linked documentation above for more details).
fragmentDelimiter: ' ... ' # Delimiter string used to concatenate fragments. Defaults to " ... ".
```
**Note:** the highlight search term feature uses `ts_headline` which has been known to potentially impact performance. You only need this minimal config to disable it should you have issues:
```yaml
search:
pg:
highlightOptions:
useHighlight: false
```
The Postgres documentation on [Highlighting Results](https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-HEADLINE) has more details.
+1 -1
View File
@@ -48,7 +48,7 @@ export interface Config {
*/
highlightAll?: boolean;
/**
* maximum number of text fragments to display. The default value of zero selects a non-fragment-based headline generation method.
* Maximum number of text fragments to display. The default value of zero selects a non-fragment-based headline generation method.
* A value greater than zero selects fragment-based headline generation (see the linked documentation above for more details).
*/
maxFragments?: number;