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.
string
required
The search query string.
string[]
Which content types to search: any of "entity", "comment", "message".
string
Scope the search to a specific space.
string
Scope the search to a specific conversation.
number
Maximum number of results to return.
string
Opts each result’s author into a spaceReputation number. Accepts a space <uuid>, "none" (the project-general bucket), or "context" (the space derived from the request context). The empty string and the legacy general / null aliases are rejected. See Reputation.
boolean
Only honored alongside an explicit space <uuid>. When true, spaceReputation is the subtree sum — the named space plus all of its descendants.
ReturnsPromise<PaginatedResponse<Entity>>

searchUsers

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

searchSpaces

Searches for spaces by name or description.
string
required
The search query string.
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.
string
required
The natural-language question to answer.
string[]
Which content types to draw from: any of "entity", "comment", "message".
string
Scope the search to content within a specific space.
string
Scope the search to a specific conversation.
number
Maximum number of sources to draw from.
string
Opts each source’s author into a spaceReputation number. Accepts a space <uuid>, "none" (the project-general bucket), or "context" (the space derived from the request context). The empty string and the legacy general / null aliases are rejected. See Reputation.
boolean
Only honored alongside an explicit space <uuid>. When true, spaceReputation is the subtree sum — the named space plus all of its descendants.
ReturnsPromise<{ answer: string; sources?: Array<{ entityId: string; title: string | null }> }>