Jump to content

Community

REST API Documentation

/core/search


Perform a search and get a list of results

For requests using an OAuth Access Token for a particular member, only content the authorized user can view will be included and the "search_as" parameter will be ignored.


Parameters

Name Type Description
page int Page number
perPage int Number of results per page - defaults to 25
q string String to search for
tags string Comma-separated list of tags to search for
type string Content type class to restrict searches to
item int Restrict searches to comments or reviews made to the specified item
nodes string Comma-separated list of node IDs to restrict searches to
search_min_comments int Minimum number of comments search results must have for content types that support comments
search_min_replies int Minimum number of comments search results must have for content types that require the first comment (e.g. topics)
search_min_reviews int Minimum number of reviews search results must have
search_min_views int Minimum number of views search results must have (note, not supported by elasticsearch)
author string Restrict searches to results posted by this member (name)
club string Comma-separated list of club IDs to restrict searches to
start_before string Date period (from current time) that search results should start before
start_after string Date period (from current time) that search results should start after
updated_before string Date period (from current time) that search results should last be updated before
updated_after string Date period (from current time) that search results should last be updated after
sortby string Sort by method (newest or relevancy)
eitherTermsOrTags string Whether to search both tags and search term ("and") or either ("or")
search_and_or string Whether to perform an "and" search or an "or" search for all search terms
search_in string Specify "titles" to search in titles only, otherwise titles and content are both searched
search_as int Member ID to perform the search as (guest permissions will be used when this parameter is omitted)

Exceptions

This endpoint doesn't throw any exceptions.

Response

Name Type Description
page int The page number for the results being shown
perPage int The number of results that will be on each page
totalResults int The total number of results
totalPages int The number of pages of results
results array of result objects The results for this page

result object

Name Type Description
title string Title of search result
content string Content of search result
class string Content class of search result
objectId int Content ID of search result
itemClass string Content item class of search result (if search result is of a content item, this will match class)
itemId int Content item ID of search result (if search result is of a content item, this will match objectId)
started datetime Datetime search result was submitted
updated datetime Datetime search result was last updated
itemUrl string URL to content item
objectUrl string URL to search result item (if search result is of a content item, this will match itemUrl)
reputation int Number of reputation points for search result
comments nt|null object Number of comments or replies for search result, or NULL if commenting is not supported
reviews nt|null object Number of reviews for search result, or NULL if reviewing is not supported
container string Title of container of search result
containerUrl string URL to container of search result
author string Author name of search result
authorUrl tring|null object URL to author's profile, or NULL if search result was submitted by a guest
authorPhoto string URL to author's profile photo
authorPhotoThumbnail string URL to author's profile photo thumbnail
tags array Array of tags associated with the search result
×
×
  • Create New...