[PR #3857] [MERGED] feat: full text search for TeamCollections and TeamRequests #4558

Closed
opened 2026-03-17 02:05:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3857
Author: @balub
Created: 2/25/2024
Status: Merged
Merged: 3/5/2024
Merged by: @AndrewBastin

Base: release/2024.3.0Head: feat/full-text-search


📝 Commits (10+)

  • 391499c feat: added a new route to handle search queries
  • 02b395d chore: made a team member guard for rest routes
  • de36929 chore: created new search results query response type
  • 50496a5 feat: implemented FTS for team-collections
  • 42ab512 feat: implemented FTS for team-requests
  • fb22a11 chore: removed unused typecast
  • dec0f59 chore: added private keyword to helper functions
  • 3f3134a chore: created new error const for FTS
  • 8c7e427 chore: fixed issue with incorrect object in tree generation
  • 7d15532 feat: created new migration file for fts additions to database tables

📊 Changes

19 files changed (+474 additions, -45 deletions)

View changed files

📝 docker-compose.yml (+3 -3)
packages/hoppscotch-backend/prisma/migrations/20240226053141_full_text_search_additions/migration.sql (+17 -0)
📝 packages/hoppscotch-backend/prisma/schema.prisma (+11 -11)
📝 packages/hoppscotch-backend/src/auth/auth.controller.ts (+2 -6)
📝 packages/hoppscotch-backend/src/auth/auth.service.ts (+4 -4)
📝 packages/hoppscotch-backend/src/auth/guards/github-sso.guard.ts (+2 -1)
📝 packages/hoppscotch-backend/src/auth/guards/google-sso.guard.ts (+2 -1)
📝 packages/hoppscotch-backend/src/auth/guards/microsoft-sso-.guard.ts (+2 -1)
📝 packages/hoppscotch-backend/src/auth/helper.ts (+0 -10)
📝 packages/hoppscotch-backend/src/errors.ts (+26 -0)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.controller.ts (+4 -4)
packages/hoppscotch-backend/src/team-collection/helper.ts (+14 -0)
packages/hoppscotch-backend/src/team-collection/team-collection.controller.ts (+38 -0)
📝 packages/hoppscotch-backend/src/team-collection/team-collection.module.ts (+2 -0)
📝 packages/hoppscotch-backend/src/team-collection/team-collection.service.ts (+270 -1)
packages/hoppscotch-backend/src/team/guards/rest-team-member.guard.ts (+47 -0)
packages/hoppscotch-backend/src/types/CollectionSearchNode.ts (+17 -0)
📝 packages/hoppscotch-backend/src/types/RESTError.ts (+2 -2)
📝 packages/hoppscotch-backend/src/utils.ts (+11 -1)

📄 Description

Closes HSB-322

Description

In this PR we introduce a new route that allows for full-text search to be performed over saved team collections and requests.

GET http://localhost:3170/v1/team-collection/search/:teamID/:searchQuery?take=5&skip=2

We also have simple offset pagination available using the take and skip query params.

An example response to the above query may be like the following:

{
  "data": [
   .........,
    {
      "type": "collection",
      "title": "Get Started for BSPs",
      "id": "clt1k7d6u02h9ioerkkia6b7h",
      "path": [
        {
          "id": "clt1k7d6p02goioeri3f85nju",
          "title": "Cloud API",
          "type": "collection",
          "path": []
        }
      ]
    },
   .........,
    {
      "type": "request",
      "title": "get request",
      "method": "GET",
      "id": "clt1k7cm9000hioerpzpfpmb0",
      "path": [
        {
          "id": "clt1k7cm9000fioer57bl0n9d",
          "title": "child collection",
          "type": "collection",
          "path": {
            "id": "clt1k7cm70006ioer65sc2xsb",
            "title": "Currency Rates API",
            "type": "collection",
            "path": []
          }
        }
      ]
    },
   .........,
  ]
}

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3857 **Author:** [@balub](https://github.com/balub) **Created:** 2/25/2024 **Status:** ✅ Merged **Merged:** 3/5/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2024.3.0` ← **Head:** `feat/full-text-search` --- ### 📝 Commits (10+) - [`391499c`](https://github.com/hoppscotch/hoppscotch/commit/391499c788a511c81ebf5ca2079f6123a36aaa17) feat: added a new route to handle search queries - [`02b395d`](https://github.com/hoppscotch/hoppscotch/commit/02b395d72dea9093c6cccd226faae7a88ffdbf5b) chore: made a team member guard for rest routes - [`de36929`](https://github.com/hoppscotch/hoppscotch/commit/de3692962b224220234dd1f81a0ba590629c1678) chore: created new search results query response type - [`50496a5`](https://github.com/hoppscotch/hoppscotch/commit/50496a5d00cf25f498739bc30be82a5484112110) feat: implemented FTS for team-collections - [`42ab512`](https://github.com/hoppscotch/hoppscotch/commit/42ab512250e5796e6c97b767daa421e561b7f395) feat: implemented FTS for team-requests - [`fb22a11`](https://github.com/hoppscotch/hoppscotch/commit/fb22a11ef6ad78a2a92fe616e0edad81a987e555) chore: removed unused typecast - [`dec0f59`](https://github.com/hoppscotch/hoppscotch/commit/dec0f598087fdadf0cf2e9df8f2b03384d52ee39) chore: added private keyword to helper functions - [`3f3134a`](https://github.com/hoppscotch/hoppscotch/commit/3f3134aff824019991d72ddd4d92c26c2b5af4f7) chore: created new error const for FTS - [`8c7e427`](https://github.com/hoppscotch/hoppscotch/commit/8c7e427ddd23b896fa3c886173720e49eb736ab3) chore: fixed issue with incorrect object in tree generation - [`7d15532`](https://github.com/hoppscotch/hoppscotch/commit/7d155321bd4e77ce499086881e067ec771098031) feat: created new migration file for fts additions to database tables ### 📊 Changes **19 files changed** (+474 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `docker-compose.yml` (+3 -3) ➕ `packages/hoppscotch-backend/prisma/migrations/20240226053141_full_text_search_additions/migration.sql` (+17 -0) 📝 `packages/hoppscotch-backend/prisma/schema.prisma` (+11 -11) 📝 `packages/hoppscotch-backend/src/auth/auth.controller.ts` (+2 -6) 📝 `packages/hoppscotch-backend/src/auth/auth.service.ts` (+4 -4) 📝 `packages/hoppscotch-backend/src/auth/guards/github-sso.guard.ts` (+2 -1) 📝 `packages/hoppscotch-backend/src/auth/guards/google-sso.guard.ts` (+2 -1) 📝 `packages/hoppscotch-backend/src/auth/guards/microsoft-sso-.guard.ts` (+2 -1) 📝 `packages/hoppscotch-backend/src/auth/helper.ts` (+0 -10) 📝 `packages/hoppscotch-backend/src/errors.ts` (+26 -0) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.controller.ts` (+4 -4) ➕ `packages/hoppscotch-backend/src/team-collection/helper.ts` (+14 -0) ➕ `packages/hoppscotch-backend/src/team-collection/team-collection.controller.ts` (+38 -0) 📝 `packages/hoppscotch-backend/src/team-collection/team-collection.module.ts` (+2 -0) 📝 `packages/hoppscotch-backend/src/team-collection/team-collection.service.ts` (+270 -1) ➕ `packages/hoppscotch-backend/src/team/guards/rest-team-member.guard.ts` (+47 -0) ➕ `packages/hoppscotch-backend/src/types/CollectionSearchNode.ts` (+17 -0) 📝 `packages/hoppscotch-backend/src/types/RESTError.ts` (+2 -2) 📝 `packages/hoppscotch-backend/src/utils.ts` (+11 -1) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes HSB-322 ### Description <!-- Add a brief description of the pull request --> In this PR we introduce a new route that allows for full-text search to be performed over saved team collections and requests. `GET http://localhost:3170/v1/team-collection/search/:teamID/:searchQuery?take=5&skip=2` We also have simple offset pagination available using the `take` and `skip` query params. An example response to the above query may be like the following: ``` { "data": [ ........., { "type": "collection", "title": "Get Started for BSPs", "id": "clt1k7d6u02h9ioerkkia6b7h", "path": [ { "id": "clt1k7d6p02goioeri3f85nju", "title": "Cloud API", "type": "collection", "path": [] } ] }, ........., { "type": "request", "title": "get request", "method": "GET", "id": "clt1k7cm9000hioerpzpfpmb0", "path": [ { "id": "clt1k7cm9000fioer57bl0n9d", "title": "child collection", "type": "collection", "path": { "id": "clt1k7cm70006ioer65sc2xsb", "title": "Currency Rates API", "type": "collection", "path": [] } } ] }, ........., ] } ``` <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [x] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:05:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4558
No description provided.