From 281f44b1e2b3ef4b9bb474a0e935a185773b54c1 Mon Sep 17 00:00:00 2001 From: Jonathan Stevens Date: Fri, 28 Jun 2024 17:51:01 -0600 Subject: [PATCH] fix(docs): fixing/simplifying new backend system search imports Signed-off-by: Jonathan Stevens --- docs/features/search/how-to-guides.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/features/search/how-to-guides.md b/docs/features/search/how-to-guides.md index 6564fd0a44..9ce30da556 100644 --- a/docs/features/search/how-to-guides.md +++ b/docs/features/search/how-to-guides.md @@ -396,21 +396,17 @@ Recently, the Backstage maintainers [announced the new Backend System](https://b In "packages/backend/index.ts", install the search plugin [1], the search engine [2], and the search collators/decorators modules [3]: ```ts -import { searchPlugin } from '@backstage/plugin-search-backend/alpha'; -import { searchModuleElasticsearchEngine } from '@backstage/plugin-search-backend-module-elasticsearch/alpha'; -import { searchModuleCatalogCollator } from '@backstage/plugin-search-backend-module-catalog/alpha'; -import { searchModuleTechDocsCollator } from '@backstage/plugin-search-backend-module-techdocs/alpha'; -import { searchModuleExploreCollator } from '@backstage/plugin-search-backend-module-explore/alpha'; - const backend = createBackend(); // [1] adding the search plugin to the backend -backend.add(searchPlugin()); +backend.add(import('@backstage/plugin-search-backend/alpha')); // [2] (optional) the default search engine is Lunr, if you want to extend the search backend with another search engine. -backend.add(searchModuleElasticsearchEngine()); +backend.add( + import('@backstage/plugin-search-backend-module-elasticsearch/alpha'), +); // [3] extending search with collator modules to start index documents, take in optional schedule parameters. -backend.add(searchModuleCatalogCollator()); -backend.add(searchModuleTechDocsCollator()); -backend.add(searchModuleExploreCollator()); +backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-explore/alpha')); backend.start(); ```