Skip to main content
Sublay provides three semantic search hooks — one for content (entities, comments, messages), one for users, and one for spaces. All three return results ranked by semantic similarity to the query.

useSearchContent

Search across entities, comments, and chat messages. You can filter by sourceTypes to target only specific content types, or scope results to a specific space or conversation.

Parameters (search function)

string
required
The natural language search query.
("entity" | "comment" | "message")[]
Limit results to specific content types. Defaults to all types.
string
Scope results to a specific space.
string
Scope results to a specific conversation (for messages).
number
Maximum number of results to return.

Returns

ContentSearchResult[]
Ranked results.
boolean
true while a search is in progress.
string | null
Error message if the search failed.
Executes the search and updates results.
() => void
Clears results and error state.

useSearchUsers

Search for users by natural language query — matches against name, username, bio, and other profile text.

Parameters (search function)

string
required
The natural language search query.
number
Maximum number of results to return.

Returns

UserSearchResult[]
Ranked user results.
boolean
string | null
(props) => Promise<void>
() => void

useSearchSpaces

Search for spaces by name, description, or topic.

Parameters (search function)

string
required
The natural language search query.
number
Maximum number of results to return.

Returns

SpaceSearchResult[]
Ranked space results.
boolean
string | null
(props) => Promise<void>
() => void