Skip to content
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

后台页面新增按照访问量和评论量排序功能 #3216

Closed
xiuyuanjun opened this issue Feb 3, 2023 · 10 comments · Fixed by #5614
Closed

后台页面新增按照访问量和评论量排序功能 #3216

xiuyuanjun opened this issue Feb 3, 2023 · 10 comments · Fixed by #5614
Assignees
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@xiuyuanjun
Copy link

你当前使用的版本

2.2.0

描述一下此特性

在后台页面新增按照访问量和评论量排序功能。

附加信息

微信截图_20230203140634

@guqing
Copy link
Member

guqing commented Feb 3, 2023

/kind feature
/area core
/priority important-soon

@f2c-ci-robot f2c-ci-robot bot added kind/feature Categorizes issue or PR as related to a new feature. area/core Issues or PRs related to the Halo Core labels Feb 3, 2023
@guqing
Copy link
Member

guqing commented Feb 3, 2023

/priority important-soon

@f2c-ci-robot f2c-ci-robot bot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Feb 3, 2023
@halo-dev halo-dev deleted a comment from f2c-ci-robot bot Feb 3, 2023
@ruibaby ruibaby added this to the 2.14.x milestone Mar 17, 2024
@ZJamss ZJamss removed their assignment Mar 25, 2024
@ZJamss
Copy link
Contributor

ZJamss commented Mar 27, 2024

/assign

@ZJamss
Copy link
Contributor

ZJamss commented Mar 27, 2024

image
我的思路是配置一下国际化同时修改一下排序规则,请问思路有问题吗

@ruibaby
Copy link
Member

ruibaby commented Mar 27, 2024

我的思路是配置一下国际化同时修改一下排序规则,请问思路有问题吗

没问题,但需要注意检查访问量和评论量的字段是否有添加索引。

@guqing
Copy link
Member

guqing commented Mar 27, 2024

我的思路是配置一下国际化同时修改一下排序规则,请问思路有问题吗

没问题,但需要注意检查访问量和评论量的字段是否有添加索引。

这些访问量这些数据没有在文章的数据里面,所以无法增加索引和排序,目前没有想到一个好的方法来处理这件事,所以一直没做

@JohnNiang
Copy link
Member

我这里有一个不成熟的思路:

定期同步访问量和评论量到文章的 annotations 中,然后我们创建对应的索引。这样就可以非常方便地添加对应的排序功能了。

@guqing
Copy link
Member

guqing commented Mar 28, 2024

我这里有一个不成熟的思路:

定期同步访问量和评论量到文章的 annotations 中,然后我们创建对应的索引。这样就可以非常方便地添加对应的排序功能了。

方向上目前来看我能想到的也是这种方式,但是在同步上希望考虑数据上尽量精准,最好不要查询所有文章去一个一个同步
比如可以监听 Counter 的改动,如果是文章的 Counter 则发布一个事件将数据放里面,然后写一个 Queue 去处理更新,如果 queue 中有多条同一篇文章的数据应该在内存合并一下之类的,或者其他更高效的方式以避免无效更新

@ZJamss
Copy link
Contributor

ZJamss commented Mar 28, 2024

我最后的思路是在创建索引数据的时候新加一些逻辑判断或方法,用来全量读取一次访问量和评论量的索引数据并创建索引(没想好有什么不错的构建索引数据的方法),运行时通过counter和traker的数据进行事件处理来更新索引

@JohnNiang
Copy link
Member

这个issue我还能做吗?: (,我最后的思路是在创建索引数据的时候新加一些逻辑判断或方法,用来全量读取一次访问量和评论量的索引数据并创建索引(没想好有什么不错的构建索引数据的方法),运行时通过counter和traker的数据进行事件处理来更新索引

Hi @ZJamss ,也许你可以尝试一下。

@ruibaby ruibaby modified the milestones: 2.14.x, 2.15.x Apr 1, 2024
f2c-ci-robot bot pushed a commit that referenced this issue Apr 11, 2024
#### What type of PR is this?
/kind feature

#### What this PR does / why we need it:
文章支持根据访问量和评论量排序

#### Which issue(s) this PR fixes:

Fixes #3216 

#### Does this PR introduce a user-facing change?

```release-note
文章支持根据访问量和评论量排序
```
@ruibaby ruibaby modified the milestones: 2.15.x, 2.15.0 Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants