-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(web): Fix query for generic and team member lists #17115
Conversation
WalkthroughThe changes in this pull request involve modifications to several service classes within the CMS library. Key updates include enhancements to query handling in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17115 +/- ##
==========================================
- Coverage 35.73% 35.73% -0.01%
==========================================
Files 6928 6928
Lines 147817 147824 +7
Branches 42127 42129 +2
==========================================
Hits 52818 52818
- Misses 94999 95006 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 10 Total Test Services: 0 Failed, 9 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
libs/cms/src/lib/search/importers/teamList.service.ts (1)
34-43
: LGTM! Consider adding null checks for content sections.The new content generation approach using an array to combine multiple sections is a good improvement. It makes the content more comprehensive by including both the intro and title.
Consider adding null/undefined checks before pushing content sections:
-contentSection.push( - memberEntry?.fields?.intro - ? documentToPlainTextString(memberEntry.fields.intro) - : '', -) +if (memberEntry?.fields?.intro) { + contentSection.push(documentToPlainTextString(memberEntry.fields.intro)) +}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
libs/cms/src/lib/cms.elasticsearch.service.ts
(2 hunks)libs/cms/src/lib/search/importers/genericListItem.service.ts
(1 hunks)libs/cms/src/lib/search/importers/teamList.service.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
libs/cms/src/lib/search/importers/genericListItem.service.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/cms/src/lib/search/importers/teamList.service.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/cms/src/lib/cms.elasticsearch.service.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (3)
libs/cms/src/lib/search/importers/genericListItem.service.ts (1)
54-56
: LGTM! Content enhancement with filter tags.
The addition of filter tag titles to the content sections improves searchability and maintains consistency with the team list implementation.
libs/cms/src/lib/cms.elasticsearch.service.ts (2)
512-514
: LGTM! Improved query string normalization.
The addition of trim()
and consistent case handling improves search reliability by normalizing input.
525-525
: Verify the impact of stricter query matching.
The addition of default_operator: 'and'
makes search more precise by requiring all terms to match. This aligns with the PR objective to prevent unexpected item rearrangement.
Let's verify the query behavior:
✅ Verification successful
The default_operator: 'and'
change is consistent with existing implementations
The verification shows that this change aligns with existing search behavior in the codebase. The same configuration is already used in libs/content-search-toolkit/src/queries/search.ts
, indicating this is a standardized approach across the application. Other search implementations either already use the 'and' operator or are specialized for different use cases (like wildcard searches in the API catalogue).
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for existing query string usage to assess impact
# Search for query string configurations
rg -A 5 'simple_query_string' --type ts
Length of output: 1928
Script:
#!/bin/bash
# Let's check for any test files or specs that might verify the search behavior
rg -l "test|spec" --type ts | rg -i "search|elasticsearch"
# Also check for any documentation about the search functionality
fd -e md | xargs rg -l "search|query"
Length of output: 2815
* Fix query for generic and team member lists * Add tags to be searchable in gengeric list search * Add title to be searchable in team member list search --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Fix query for generic and team member lists * Add tags to be searchable in gengeric list search * Add title to be searchable in team member list search --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* fix(web): Fix query for generic and team member lists (#17115) * Fix query for generic and team member lists * Add tags to be searchable in gengeric list search * Add title to be searchable in team member list search --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(web): Sort by title for generic list and team list (#17226) * Add title.sort again * No need to have _score type --------- Co-authored-by: mannipje <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Fix query for generic and team member lists
What
Why
So the items in the list is not jumping around on search filtering the list of items.
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation