diff --git a/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx b/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx
index a7307055c2..fbb8f7b132 100644
--- a/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx
+++ b/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx
@@ -25,7 +25,7 @@ import {
makeStyles,
} from '@material-ui/core';
import { Link } from '@backstage/core-components';
-import { useAnalytics } from '@backstage/core-plugin-api';
+import { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api';
import {
IndexableDocument,
ResultHighlight,
@@ -63,15 +63,19 @@ export function CatalogSearchResultListItem(
const classes = useStyles();
const analytics = useAnalytics();
+
+ const configApi = useApi(configApiRef);
+ const to = configApi.getString('app.baseUrl').concat(result.location);
+
const handleClick = () => {
analytics.captureEvent('discover', result.title, {
- attributes: { to: result.location },
+ attributes: { to },
value: props.rank,
});
};
return (
-
+
{props.icon && {props.icon}}