From 66afe2e014196f66904271671f6b9801051576e4 Mon Sep 17 00:00:00 2001 From: Dede Hamzah Date: Wed, 23 Feb 2022 10:40:27 +0700 Subject: [PATCH] Update how to guide search on limiting where techdocs collator is searching the documents Signed-off-by: Dede Hamzah --- docs/features/search/how-to-guides.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/features/search/how-to-guides.md b/docs/features/search/how-to-guides.md index a3c42c682c..51a71ee314 100644 --- a/docs/features/search/how-to-guides.md +++ b/docs/features/search/how-to-guides.md @@ -131,3 +131,26 @@ indexBuilder.addCollator({ As shown above, you can add a catalog entity filter to narrow down what catalog entities are indexed by the search engine. + +## How to limit where TechDocs Collator scanning the Software Catalog + +The DefaultTechDocsCollator is responsible for indexing the TechDocs into search. +The way it does is by getting all the entities every refresh interval from the +catalog and find the entities that has annotation `backstage.io/techdocs-ref`, +the process of getting all the entities is quite expensive if you have a large +amount of entity catalog data. To relieve the process, you can filter where the +DefaultTechDocsCollator is scanning your entities. + +```typescript +indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: DefaultTechDocsCollator.fromConfig(config, { + discovery, + logger, + tokenManager, ++ filter: { ++ kind: ['API', 'Component', 'Domain', 'System'], ++ }, + }), +}); +```