Skip to main content

Global Search

Global Search API provides access to search across various resources for the authenticated user.

This endpoint retrieves search results based on the query and filters provided by the authenticated user.

HTTP Request

GET /api/v2.5/global_search/search_results/

Query Parameters

ParameterTypeDescription
qstringThe search query string. Useful to search for specific keywords or phrases.
pageintThe page number for pagination. Defaults to 1.
sizeintThe number of results to return per page. Defaults to 10.

Filter Parameters

The param query parameter can be accompanied by parameters that specify filtering criteria.

Base Filters

ParameterTypeDescription
coursestringFilter results for courses.
chapterstringFilter results for chapters.
chaptercontentstringFilter results by contents.
productstringFilter results by product categories.
poststringFilter results by posts.
ticketstringFilter results by user tickets (doubts).
forumthreadstringFilter results related to forum discussions.
forumthreadcategorystringFilter results by categories of discussions.
customtestattemptstringFilter results by custom tests.

Additional Filters

KeyParameterTypeDescription
chaptercontent_content_typeVideostringFilter results specifically for video content.
chaptercontent_content_typeExamstringFilter results specifically for exam content.
chaptercontent_content_typeNotesstringFilter results for note-taking content.
chaptercontent_content_typeVideoconferencestringFilter results specifically for video conference content.
chaptercontent_content_typeLivestreamstringFilter results specifically for live stream content.
chaptercontent_content_typeAttachmentstringFilter results for attachments.
chaptercontent_content_typeQuizstringFilter results for quiz content.

Note:

  • Base filters need to be included before adding additional filters.
  • You can refer to the example usage below for clarity.
  • Currently, additional filters for chapter content type and user status are the only advanced filtering options available. More advanced filtering is not yet implemented.
curl --request GET \
--url "http://demo.testpress.in/api/v2.5/global_search/search_results/?q=your_search_query&page=1&size=10&param=product&param=chaptercontent&chaptercontent_content_type=Video&param=user&user_status=Student" \
--header 'authorization: JWT your_jwt_token' \
--header 'cache-control: no-cache'

Response

Note: The following example response corresponds to a search query for the term "course".

{
"results": [
{
"description": "",
"title": "Science course",
"created": "2024-07-25T07:03:03.093928+00:00",
"slug": "science-course",
"institute_subdomain": "demo",
"state": "Published",
"highlight": {"title": "Science <span class='highlight'>course</span>"},
"type": "course",
"id": 80
},
{
"description": "",
"title": "Maths course",
"created": "2024-07-25T06:52:16.206599+00:00",
"slug": "maths-course",
"institute_subdomain": "demo",
"state": "Published",
"highlight": {"title": "Maths <span class='highlight'>course</span>"},
"type": "course",
"id": 79
},
],
"nextPage": 2
}