fix(search): extend messages text index to include attachment fields#40874
fix(search): extend messages text index to include attachment fields#40874rish106-hub wants to merge 3 commits into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 0530727 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
WalkthroughThis PR extends MongoDB text indexing for message search to include attachment-related text fields (text, title, description, pretext, author_name) beyond the message body, enabling search results to match content within post attachments. The configuration, validation logic, and index creation are updated together with release notes. ChangesMessage Search Index Expansion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
rish106-hub
left a comment
There was a problem hiding this comment.
Commented in CodeRabbit Change Stack
rish106-hub
left a comment
There was a problem hiding this comment.
Commented in CodeRabbit Change Stack
|
Hi @ggazzo and @KevLehman , the PR is ready for review. All automated checks (cubic, CodeRabbit, CLA) are passing with no issues flagged. Would appreciate a review when you get a chance. Happy to make any changes if needed! |
Auto-generated names for large text indexes can exceed MongoDB's 127-byte limit on older versions/FCV, causing startup failure. Explicit short names prevent this.
Proposed changes
Renaming a room or using integrations to post with attachments — the attachment content (
title,description,text,pretext,author_name) was never included in MongoDB's text index on themessagescollection. Onlymsg(message body) was indexed, so searching for terms that appeared only in attachments returned no results.Fix: Extend the text index to cover attachment text fields. On startup,
ensureMessagesTextIndexdetects the oldmsg-only index, drops it, and rebuilds with the new shape automatically.Issue
Closes #2938
Steps to test or reproduce
titleortextfield containing a unique search term — but leave the message body empty or with different textFurther comments
defaultandroom-scoped(USE_ROOM_SEARCH_INDEX=true) index shapes are updatedclassifyTextIndexupdated to match new weight set so stale old index is detected and replacedSummary by CodeRabbit