DecoratorBase.decorate()
Home > @backstage/plugin-search-backend-node
> DecoratorBase
> decorate
Receives a single indexable document. In your decorate method, you can:
- Resolve
undefined
to indicate the record should be omitted. - Resolve a single modified document, which could contain new fields, edited fields, or removed fields. - Resolve an array of indexable documents, if the purpose if the decorator is to convert one document into multiple derivative documents.
Signature:
abstract decorate(document: IndexableDocument): Promise<IndexableDocument | IndexableDocument[] | undefined>;
Parameters
Parameter |
Type |
Description |
---|---|---|
document |
Promise<IndexableDocument | IndexableDocument[] | undefined>