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.
pageintOptional: The page number for pagination (defaults to 1).
sizeintOptional: The 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.
examstringFilter results by exams(available).
productstringFilter results by product categories.
productcategorystringFilter results by product categories.
poststringFilter results by posts.
postcategorystringFilter results by the category of the post.
ticketstringFilter results by user tickets (doubts).
tickettopicstringFilter results by specific topics within tickets.
forumthreadstringFilter results related to forum discussions.
forumthreadcategorystringFilter results by categories of discussions.
userstringFilter results by users.
batchintegerFilter results by user batches.
rolestringFilter results by user roles.
questionsetstringFilter results by specific question folders.
questionstringFilter results for questions.
subjectstringFilter results for subjects.
directionstringFilter results for directions.

Advanced Filters

KeyParameterTypeDescription
chaptercontent_typeVideostringFilter results specifically for video content.
chaptercontent_typeExamstringFilter results specifically for exam content.
chaptercontent_typeNotesstringFilter results for note-taking content.
chaptercontent_typeVideoconferencestringFilter results specifically for video conference content.
chaptercontent_typeLivestreamstringFilter results specifically for live stream content.
chaptercontent_typeAttachmentstringFilter results for attachments.
chaptercontent_typeQuizstringFilter results for quiz content.
user_statusStudentstringFilter results by user status (e.g., Student).
user_statusAdminstringFilter results by user status (e.g., Admin).
user_statusMentorstringFilter results by user status (e.g., Mentor).
user_statusStaffstringFilter results by user status (e.g., Staff).

Note:

  • Base filters need to be included before adding additional filters.
  • You can refer to the example usage below for clarity.
  • Currently, the only advanced filtering options available are for chapter content types and user statuses. 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 example response below is for the search query "course."

{
"results": [
{
"description": "",
"created": "2024-05-16T09:12:35.641830+00:00",
"id": 9,
"institute_subdomain": "demo",
"highlight": {"name": "Batch <span class='highlight'>Course</span>"},
"is_hidden": false,
"type": "batch",
"slug": "batch3",
"name": "Batch Course"
},
{
"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
},
{
"status": "Student",
"first_name": "testpress",
"created": "2024-05-17T08:37:13.851032+00:00",
"id": 23,
"email": "testpress@x.com",
"username": "testpress",
"state": "",
"date_joined": "2024-05-17T08:37:13.851060+00:00",
"last_name": "",
"highlight": {"membership_set.batches.name": "Batch <span class='highlight'>Course</span>"},
"type": "user",
"institute_subdomain": "demo",
}
],
"nextPage": 2
}