feat: add search filters for deprecated packages and newly published …
…packages
Implemented two new search filter configurations:
-
searchExcludeDeprecated- Filter deprecated packages from search results- Default: true (deprecated packages are excluded by default)
- Can be disabled by setting to false
- Controlled by env: CNPMCORE_CONFIG_SEARCH_EXCLUDE_DEPRECATED
-
searchPackageMinAge- Filter newly published packages- Default: empty string (no filter applied)
- Supports time format: '2w' (weeks), '14d' (days), '336h' (hours)
- Controlled by env: CNPMCORE_CONFIG_SEARCH_PACKAGE_MIN_AGE
Changes:
- Added
deprecatedfield to SearchMappingType and sync it to Elasticsearch - Added
_buildFilterQueries()method to build Elasticsearch filter conditions - Added
_parseTimeString()helper to parse time strings (h/d/w format) - Added comprehensive unit tests for the new filter functionality
Closes #858
🤖 Generated with Claude Code
How to use the Graphite Merge Queue
Add either label to this PR to merge it via the merge queue:
- MQ - adds this PR to the back of the merge queue
- Hotfix - for urgent hot fixes, skip the queue and merge this PR next
You must have a Graphite account in order to use the merge queue. Sign up using this link.
An organization admin has enabled the Graphite Merge Queue in this repository.
Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
claude/implement-issue-858-011CURYUu9i46HHcFVRQ5fFV
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 @coderabbitai help to get the list of available commands and usage tips.