Search Queries
The API provides three types of search functionality:
- Search Posts
- Search Comments
- Search Board Users
Search Posts
Search for posts across a board.
Query Structure
query SearchPosts(
$query: String!
$limit: Int
$offset: Int
$orderBy: PostOrderByInput
$showDeleted: Boolean
) {
searchPosts(
query: $query
limit: $limit
offset: $offset
orderBy: $orderBy
showDeleted: $showDeleted
) {
results {
id
title
pid
trendingScore
upvoteCount
downvoteCount
commentCount
dateDeleted
}
nbHits
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
query | String! | Search query string |
limit | Int | Maximum number of results to return (default: 10) |
offset | Int | Number of results to skip (default: 0) |
orderBy | PostOrderByInput | Sort order for results |
showDeleted | Boolean | Whether to include deleted posts (default: false) |
PostOrderByInput Enum
| Value | Description |
|---|---|
dateUpdated | Sort by last update date |
trendingScore | Sort by trending score |
upvoteCount | Sort by number of upvotes |
downvoteCount | Sort by number of downvotes |
commentCount | Sort by number of comments |
Return Type
| Field | Type | Description |
|---|---|---|
results | [PostData!]! | Array of matching posts |
nbHits | Int! | Total number of matches found |
PostData Type
| Field | Type | Description |
|---|---|---|
id | ID! | Post ID |
title | String! | Post title |
pid | String! | Post unique identifier |
trendingScore | Float! | Post trending score |
upvoteCount | Int! | Number of upvotes |
downvoteCount | Int! | Number of downvotes |
commentCount | Int! | Number of comments |
dateDeleted | String | Deletion date if post is deleted |
Search Comments
Search for comments within a post or across all posts.
Query Structure
query SearchComments(
$query: String!
$postId: ID
$limit: Int
$offset: Int
$showDeleted: Boolean
) {
searchComments(
query: $query
postId: $postId
limit: $limit
offset: $offset
showDeleted: $showDeleted
) {
results {
commentId
commentText
id
title
pid
trendingScore
upvoteCount
downvoteCount
commentCount
}
nbHits
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
query | String! | Search query string |
postId | ID | Optional post ID to limit search scope |
limit | Int | Maximum number of results to return (default: 25) |
offset | Int | Number of results to skip (default: 0) |
showDeleted | Boolean | Whether to include deleted comments (default: false) |
Return Type
| Field | Type | Description |
|---|---|---|
results | [CommentData!]! | Array of matching comments |
nbHits | Int! | Total number of matches found |
CommentData Type
| Field | Type | Description |
|---|---|---|
commentId | ID! | Comment ID |
commentText | String! | Comment text |
id | ID! | Post ID |
title | String! | Post title |
pid | String! | Post unique identifier |
trendingScore | Float! | Post trending score |
upvoteCount | Int! | Number of upvotes |
downvoteCount | Int! | Number of downvotes |
commentCount | Int! | Number of comments |
Search Board Users
Search for users within a board.
Query Structure
query SearchBoardUsers(
$query: String!
$limit: Int
$offset: Int
) {
searchBoardUsers(
query: $query
limit: $limit
offset: $offset
) {
results {
bio
email
emailOnMention
image
isSsoUser
name
ssoId
ssoType
}
nbHits
}
}
Input Fields
| Field | Type | Description |
|---|---|---|
query | String! | Search query string |
limit | Int | Maximum number of results to return (default: 25) |
offset | Int | Number of results to skip (default: 0) |
Return Type
| Field | Type | Description |
|---|---|---|
results | [BoardTeamUser!]! | Array of matching users |
nbHits | Int! | Total number of matches found |
BoardTeamUser Type
| Field | Type | Description |
|---|---|---|
bio | String | User biography |
email | String | User email |
emailOnMention | Boolean! | Whether user receives email notifications on mentions |
image | String | User profile image URL |
isSsoUser | Boolean! | Whether user is authenticated via SSO |
name | String! | User name |
ssoId | ID! | SSO identifier |
ssoType | String | Type of SSO provider |
Error Handling
All search queries require a valid API key and will return appropriate error messages if:
- The API key is invalid
- The search query fails to execute
- Required parameters are missing
Common error scenarios:
{
"errors": [
{
"message": "Invalid API key",
"extensions": {
"code": "UNAUTHENTICATED"
}
}
]
}
{
"errors": [
{
"message": "An error occurred while searching posts",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}