From 269cf40d22563ec59d161d8f1182dde5c5c2fcad Mon Sep 17 00:00:00 2001 From: Yanay Date: Tue, 30 Jun 2026 13:47:22 +0300 Subject: [PATCH] feat(search): add includeChildSpaces to searchContent/askContent Optional prop on AskContentProps/SearchContentProps, forwarded in the request body (via the existing ...body spread) so a space-scoped ask/search can cover the space's whole child-space subtree. Mirrors the server param; default off. Co-Authored-By: Claude Opus 4.8 --- src/modules/search/askContent.ts | 6 ++++++ src/modules/search/searchContent.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/modules/search/askContent.ts b/src/modules/search/askContent.ts index e9e17a2..cdbf41e 100644 --- a/src/modules/search/askContent.ts +++ b/src/modules/search/askContent.ts @@ -5,6 +5,12 @@ export interface AskContentProps extends SpaceReputationContextParams { query: string; sourceTypes?: ("entity" | "comment" | "message")[]; spaceId?: string; + /** + * With a `spaceId`, also search every space nested under it (children, + * grandchildren — the whole subtree, any depth). Ignored without a `spaceId`. + * Defaults to false (exact-space search). + */ + includeChildSpaces?: boolean; conversationId?: string; limit?: number; } diff --git a/src/modules/search/searchContent.ts b/src/modules/search/searchContent.ts index 5bcf572..7ff39fe 100644 --- a/src/modules/search/searchContent.ts +++ b/src/modules/search/searchContent.ts @@ -7,6 +7,12 @@ export interface SearchContentProps extends SpaceReputationContextParams { query: string; sourceTypes?: ("entity" | "comment" | "message")[]; spaceId?: string; + /** + * With a `spaceId`, also search every space nested under it (children, + * grandchildren — the whole subtree, any depth). Ignored without a `spaceId`. + * Defaults to false (exact-space search). + */ + includeChildSpaces?: boolean; conversationId?: string; limit?: number; }