Skip to main content
The search module provides server-side access to Sublay’s search and AI capabilities. Use it to build search APIs, power recommendation engines, or answer natural-language questions about your content.

searchContent

Searches entities by full-text query, optionally scoped to a space.
query
string
required
The search query string.
sourceTypes
string[]
Which content types to search: any of "entity", "comment", "message".
spaceId
string
Scope the search to a specific space.
includeChildSpaces
boolean
default:"false"
Only applies with spaceId. When true, the search also covers every space nested under it — the whole subtree at any depth — not just the named space. Ignored without spaceId.
conversationId
string
Scope the search to a specific conversation.
limit
number
Maximum number of results to return.
ReturnsPromise<PaginatedResponse<Entity>>

searchUsers

Searches for users by name or username.
query
string
required
The search query string.
limit
number
Maximum number of results to return.
ReturnsPromise<PaginatedResponse<User>>

searchSpaces

Searches for spaces by name or description.
query
string
required
The search query string.
limit
number
Maximum number of results to return.
ReturnsPromise<PaginatedResponse<Space>>

askContent

Asks a natural-language question about your content and returns an AI-generated answer with source references.
This feature requires semantic search to be enabled for your project. See the Semantic Search & AI guide for setup instructions.
query
string
required
The natural-language question to answer.
sourceTypes
string[]
Which content types to draw from: any of "entity", "comment", "message".
spaceId
string
Scope the search to content within a specific space.
includeChildSpaces
boolean
default:"false"
Only applies with spaceId. When true, the context lookup also covers every space nested under it — the whole subtree at any depth — so you can ask across a community and all of its channels at once. Ignored without spaceId.
conversationId
string
Scope the search to a specific conversation.
limit
number
Maximum number of sources to draw from.
ReturnsPromise<{ answer: string; sources?: Array<{ entityId: string; title: string | null }> }>

matchUsers

Matches people by activity-derived interest facets, in passive mode (against a given user’s own facets) or directed mode (against a free-text topic). See the Interest Matching guide for setup and the model.
Requires a paid plan, the ai-search and interest-matching bundles, and interestMatching.enabled on the project.
mode
string
required
"passive" or "directed".
query
string
The topic to match against. Required in directed mode; rejected in passive mode.
limit
number
default:"20"
Maximum number of matched users. Maximum 50.
spaceId
string
Restrict candidates to users active in this space.
includeChildSpaces
boolean
default:"false"
With spaceId, also include users active in the space’s subtree.
includeSampleContent
boolean
default:"false"
Request illustrative sample content per matched facet. Only honored when the project has interestMatching.exposeSampleContent on; otherwise returns 403 match/sample-content-disabled.
excludeSelf
boolean
default:"true"
Exclude the asker from results.
ReturnsPromise<{ results: UserMatchResult[] }> (the { results } envelope, ordered by descending score).