fix(search): skip entity types with ids_only and empty IDs in unified search#2529
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 51 minutes and 48 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughUpdated the construction logic of unified OpenSearch Changes
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
… search When building the OpenSearch unified search query, entity types that use ids_only mode (channels always, documents/chats when filtered by project, owner, etc.) would fail with EmptyIdsWithIdsOnly if the filter resolved to zero matching IDs. This caused a generic "unable to search" error. Now we exclude these entity types from search_indices when their ID list is empty, matching the behavior of the individual name search paths which already handle empty results gracefully.
4085b41 to
68a6011
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rust/cloud-storage/search_service/src/api/search/simple/simple_unified.rs`:
- Around line 278-295: Extend the simple_unified tests to cover the regression:
create cases where filter_document_response.ids_only == true with document_ids
empty and filter_chat_response.ids_only == true with chat_ids empty and
filter_channel_response.channel_ids empty, then assert that the produced
search_indices (or the set built in the simple_unified search flow) does NOT
contain models_opensearch::SearchEntityType::Documents, ::Chats, or ::Channels
respectively; also add complementary assertions where ids_only == false (or ids
non-empty) to verify those entity types are included. Locate the test
scaffolding that constructs filter_document_response / filter_chat_response /
filter_channel_response and the code path that produces search_indices in the
simple_unified tests, reuse those builders/mocks and add assertions for both the
ids_only=true/empty and ids_only=false cases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: fa6e2355-6a46-4569-bb63-3dae2df65fbc
📒 Files selected for processing (1)
rust/cloud-storage/search_service/src/api/search/simple/simple_unified.rs
Summary