Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow searches by exact term to increase performance #34954

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

tapiarafael
Copy link
Member

@tapiarafael tapiarafael commented Jan 16, 2025

Proposed changes (including videos or screenshots)

Allow searches by exact term in room name using quotes to have a better performance avoiding usage of regex.
This helps workspaces with large amounts of data that need to perform searches and have the full room name. Since MongoDB doesn't use indexes when using regex, this is an alternative.

Issue(s)

Steps to test or reproduce

  1. Make a GET request using double quotes to look for exact matching room names:

http://localhost:3000/api/v1/livechat/rooms?count=25&roomName=%22Visitor%22&sort=%7B%22ts%22%3A-1%7D

Or

  1. Omnichanel > Current Chats
  2. In the Guest field use the quotes to search for a room name. (Ex: "Visitor")

Further comments

SUP-707
Indexes PR

Copy link
Contributor

dionisio-bot bot commented Jan 16, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Jan 16, 2025

⚠️ No Changeset found

Latest commit: 8ae23a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 16, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34954/

Built to branch gh-pages at 2025-01-17 12:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.12%. Comparing base (c75d771) to head (8ae23a8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #34954   +/-   ##
========================================
  Coverage    59.12%   59.12%           
========================================
  Files         2819     2819           
  Lines        67856    67856           
  Branches     15115    15115           
========================================
  Hits         40123    40123           
  Misses       24905    24905           
  Partials      2828     2828           
Flag Coverage Δ
unit 75.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@tapiarafael tapiarafael marked this pull request as ready for review January 17, 2025 12:03
@tapiarafael tapiarafael changed the title feat: allow to search by exact term to increase performance feat: allow searches by exact term to increase performance Jan 17, 2025
Copy link
Contributor

@KevLehman KevLehman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some tests :whip:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants