diff --git a/api/src/app/endpoints.ts b/api/src/app/endpoints.ts index f1aa3db0..133ff309 100644 --- a/api/src/app/endpoints.ts +++ b/api/src/app/endpoints.ts @@ -12,6 +12,7 @@ import { GetProjectsForSitemapResponse, GetProjectsResponse, } from "src/project/types"; +import { SearchResponse } from "src/search/types"; // ts-prune-ignore-next export interface Endpoints { @@ -50,4 +51,8 @@ export interface Endpoints { "api:MileStones/dzcode": { response: GetMilestonesResponse; }; + "api:Search": { + response: SearchResponse; + query: [["query", string], ["limit", number]]; + }; } diff --git a/api/src/search/service.ts b/api/src/search/service.ts index b72b9acb..b2156b32 100644 --- a/api/src/search/service.ts +++ b/api/src/search/service.ts @@ -34,7 +34,7 @@ export class SearchService { indexUid: "contribution", q, limit, - attributesToRetrieve: ["id", "title", "type", "activityCount"], + attributesToRetrieve: ["id", "title", "type", "activityCount", "url"], }, { indexUid: "contributor", q, limit, attributesToRetrieve: ["id", "name", "avatarUrl"] }, ], diff --git a/web/src/_entry/app.tsx b/web/src/_entry/app.tsx index faf09521..7b39681d 100644 --- a/web/src/_entry/app.tsx +++ b/web/src/_entry/app.tsx @@ -9,6 +9,7 @@ import { TopBar, TopBarProps } from "src/components/top-bar"; import { StoreProvider } from "src/redux/store"; import { getInitialLanguageCode } from "src/utils/website-language"; import React from "react"; +import { Search } from "src/components/search"; let routes: Array< RouteProps & { @@ -119,6 +120,7 @@ const App = () => { return ( <>