Merge pull request #25195 from brianphillips/search-index-name
Index name + title of entity in default catalog collator
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Ensure name and title are both indexed by the DefaultCatalogCollator
|
||||
@@ -117,7 +117,7 @@ describe('DefaultCatalogCollator', () => {
|
||||
},
|
||||
});
|
||||
expect(documents[1]).toMatchObject({
|
||||
title: expectedEntities[1].metadata.title,
|
||||
title: `${expectedEntities[1].metadata.title} (${expectedEntities[1].metadata.name})`,
|
||||
location: '/catalog/default/component/test-entity-2',
|
||||
text: expectedEntities[1].metadata.description,
|
||||
namespace: 'default',
|
||||
|
||||
@@ -115,7 +115,9 @@ export class DefaultCatalogCollator {
|
||||
);
|
||||
return response.items.map((entity: Entity): CatalogEntityDocument => {
|
||||
return {
|
||||
title: entity.metadata.title ?? entity.metadata.name,
|
||||
title: entity.metadata.title
|
||||
? `${entity.metadata.title} (${entity.metadata.name})`
|
||||
: entity.metadata.name,
|
||||
location: this.applyArgsToFormat(this.locationTemplate, {
|
||||
namespace: entity.metadata.namespace || 'default',
|
||||
kind: entity.kind,
|
||||
|
||||
Reference in New Issue
Block a user