Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: support npm search command like npmio #513
feat: support npm search command like npmio #513
Changes from all commits
dadd39d
94d1c58
e7c2977
dbe774a
d13fc6e
97cc3df
4440c38
65757b6
6da659b
f6d0cf0
c6ff174
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
download 现在的实现估计扛不住,没有根据 packageId 来聚合的。
比如 antd 这种版本特别多的包,单次查询就要有上千条数据 感觉得换个方案。
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.
外网的包可以直接调下 npmjs 的 api,内网包现有实现确实没啥好办法。是不是可以在 redis 里给每个 package 整个 total download 计数器,写 DB 的时候同时给对应
packageId(key)
累加。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.
感觉 es 索引更新时机也是个问题,现在索引更新是依赖版本或者 tag 变更,下载量更新感觉需要在现在统计下载量的地方去触发一下 es 索引更新
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.
我看你提了个新的 ISSUE 在搞单包下载量的事情,要等你搞完吗。下载量不一定要非常准确,趋势是对的,就不会影响搜索的排名的
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.
@Beace 要不先合并我们跑下数据看看?
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.
@Beace 在申请了,我先尝试在 opensearch 导入下数据看看
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.
@Beace opensearch 试了下兼容性问题较多,没法直接用,还是继续申请 es
看计划里有同步脚本,哪里可以找呀?
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.
哦脚本遗漏了,其实就是批量调这接口
$ curl --location --request PUT 'http://localhost:7001/-/package/:package/syncs'
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.
https://github.com/cnpm/cnpmcore/blob/sync-all-packages/test/SyncAllPackages.ts#L14 思路跟这个差不多,批量调用一下
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.
/-/v1/search/sync/:fullname(${FULLNAME_REG_STRING})
👌🏻 合并完我试试单独调这个接口