diff --git a/docs/features/search/collators.md b/docs/features/search/collators.md index 0282bc845e..834a14437a 100644 --- a/docs/features/search/collators.md +++ b/docs/features/search/collators.md @@ -35,6 +35,10 @@ backend.start(); ### Configuring the Catalog Collator +The following sections outlines the available configurations for this collator. + +#### Scheduling + The default schedule for the Catalog Collator is to run every 10 minutes, you can provide your own schedule by adding it to your config: ```yaml title="app-config.yaml @@ -50,6 +54,42 @@ search: timeout: { minutes: 3 } ``` +#### Filtering + +You may wish to collate specific subsets of entities in your Catalog, this can be accomplished using the `filter` configuration option. Here's a basic example: + +```yaml title"app-config.yaml" +search: + collators: + catalog: + filter: + kind: ['component', 'api'] + spec.lifecycle: production +``` + +The above example will only collate entities that are `kind` equal to `component` or `api` AND have a `spec.lifecycle` set to `production` + +You can also apply a more advanced filter like this: + +```yaml title"app-config.yaml" +search: + collators: + catalog: + filter: + - kind: ['API'] + spec.type: openapi + - kind: ['Component'] + spec.lifecycle: experimental +``` + +Now with this example it will collate all entities that are `kind` equal to `api` with a `spec.type` equal to `openapi` OR all entities that are `kind` equal to `component` AND have a `spec.lifecycle` set to `experimental` + +:::tip + +The filter configuration is implemented using the `EntityFilterQuery` syntax. The [reference documentation on `EntityFilterQuery`](https://backstage.io/docs/reference/catalog-client.entityfilterquery/) provides more details. + +::: + ## TechDocs The TechDocs collator will index all the TechDocs in your Catalog. It is installed by default but if you need to add it manually here's how.