Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@backstage/plugin-search-backend-module-catalog
Advanced tools
A module for the search backend that exports catalog modules
This package exports a module that extends the search backend to also indexing the entities of your catalog.
Add the module package as a dependency:
# From your Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-search-backend-module-catalog
Add the collator to your backend instance, along with the search plugin itself:
// packages/backend/src/index.ts
import { createBackend } from '@backstage/backend-defaults';
const backend = createBackend();
backend.add(import('@backstage/plugin-search-backend'));
backend.add(import('@backstage/plugin-search-backend-module-catalog'));
backend.start();
You may also want to add configuration parameters to your app-config, for example for controlling the scheduled indexing interval. These parameters should be placed under the search.collators.catalog
key. See the config definition file for more details.
This module also has an extension point, which lets you inject advanced customizations. Here's an example of how to leverage that extension point to tweak the transformer used for building the search indexer documents:
// packages/backend/src/index.ts
import { createBackend } from '@backstage/backend-defaults';
import { createBackendModule } from '@backstage/backend-plugin-api';
import { CatalogCollatorEntityTransformer } from '@backstage/plugin-search-backend-module-catalog';
import { catalogCollatorExtensionPoint } from '@backstage/plugin-search-backend-module-catalog/alpha';
const customTransformer: CatalogCollatorEntityTransformer = entity => ({
title: entity.metadata.title || entity.metadata.name,
text: entity.metadata.description || '',
componentType: entity.spec?.type?.toString() || 'other',
type: entity.spec?.type?.toString() || 'other',
namespace: entity.metadata.namespace || 'default',
kind: entity.kind,
lifecycle: (entity.spec?.lifecycle as string) || '',
owner: (entity.spec?.owner as string) || '',
});
const backend = createBackend();
backend.add(import('@backstage/plugin-search-backend'));
backend.add(import('@backstage/plugin-search-backend-module-catalog'));
backend.add(
createBackendModule({
pluginId: 'search',
moduleId: 'my-catalog-collator-options',
register(reg) {
reg.registerInit({
deps: { collator: catalogCollatorExtensionPoint },
async init({ collator }) {
collator.setEntityTransformer(customTransformer);
},
});
},
})(),
);
backend.start();
FAQs
A module for the search backend that exports catalog modules
The npm package @backstage/plugin-search-backend-module-catalog receives a total of 59,356 weekly downloads. As such, @backstage/plugin-search-backend-module-catalog popularity was classified as popular.
We found that @backstage/plugin-search-backend-module-catalog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.