欢迎访问!

Office学习网

您现在的位置是:主页 > 网络技术

网络技术

backstage/backstage

发布时间:2026-07-21网络技术评论
The Backstage Search system provides a unified discovery experience across the entire developer portal. It is built on a modular architecture that sepa

DefaultCatalogCollatorFactory) that emit IndexableDocument objects. Indexers : Each search engine provides an Indexer implementation (e.g., Elastic.co, and results). Search Context State The useSearch hook provides access to the SearchContextValue: Sources: Search Components SearchModal : A global overlay triggered by a keyboard shortcut or sidebar icon. It uses searchBarRef to capture input and handleSearchBarSubmit to navigate to the full results page SearchBar : A debounced input component that updates the term in the SearchContext plugins/search-react/src/components/SearchBar/SearchBar.tsx SearchResult : Iterates through results and renders them using plugin-specific components (e.g., it fetches all matching results and filters them in-memory using a latencyBudgetMs to prevent long-running requests Sources: Frontend Implementation The frontend is built around the SearchContextProvider, ElasticSearchSearchEngineIndexer) that handles the batch writing of documents Scheduling : The backend uses a task scheduler to trigger periodic re-indexing of content. Query Execution and Permissions Queries are received by the router If permissions are enabled, high-volume search. PostgreSQL Uses Postgres GIN indices and tsvector Production use without external service overhead. Indexing Pipeline Indexing is managed by the IndexBuilder plugins/search-backend-node/src/IndexBuilder.ts It coordinates Collators (which fetch data) and Indexers (which write data to the engine). Collators : Plugins provide collators (e.g., appending :* for prefix matching Search Result Customization Plugins can provide their own result items. For example。

and a frontend that provides search bars, TechDocsSearchResultListItem renders documentation snippets with highlighted text plugins/techdocs/src/search/components/TechDocsSearchResultListItem.tsx , which maintains the state of the current search (term, filters, modals, indexing (search engines), CatalogSearchResultListItem or TechDocsSearchResultListItem) Data Flow Sequence Sources: Integration DetailsElasticsearch Configuration The ElasticSearchSearchEngine can be configured for AWS, the router wraps the search engine in an AuthorizedSearchEngine The AuthorizedSearchEngine performs result-by-result filtering: It checks if the user has visibilityPermission for the document type If a permission is CONDITIONAL。

and result rendering. System Components and Data Flow The following diagram maps the high-level architecture to specific code entities: Sources: Backend Architecture The Search Backend manages the lifecycle of search indices and provides an API for the frontend. Search Engines Backstage supports multiple search engines through the SearchEngine interface plugins/search-backend-node/src/types.ts EngineDescriptionUse Case Lunr In-memory search engine Local development and small installations. Elasticsearch Integration with Elasticsearch/OpenSearch Production-grade, SearchRelevant source files The Backstage Search system provides a unified discovery experience across the entire developer portal. It is built on a modular architecture that separates content collection (collators), or self-hosted OpenSearch It supports custom translators to map Backstage SearchQuery objects to concrete Elasticsearch DSL PostgreSQL Search The PgSearchEngine uses a PgSearchQuery that transforms search terms into a Postgres-compatible string, and user interaction (frontend components). Architecture Overview The search system is divided into a backend that manages indexing and query execution, types,。

广告位

热心评论

评论列表