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

已删除的文章出现在搜索结果中 #3121

Closed
zzudongxiang opened this issue Jan 9, 2023 · 9 comments · Fixed by #3877
Closed

已删除的文章出现在搜索结果中 #3121

zzudongxiang opened this issue Jan 9, 2023 · 9 comments · Fixed by #3877
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Milestone

Comments

@zzudongxiang
Copy link

是什么版本出现了此问题?

v2.1.0

使用的什么数据库?

H2

使用的哪种方式部署?

Docker

在线站点地址

No response

发生了什么?

在后台已删除一部分文章, 但安装搜索插件后搜索相关关键字依旧可以搜索出对应的文章结果, 点击后跳转显示404

相关日志输出

No response

附加信息

image

@ruibaby
Copy link
Member

ruibaby commented Jan 10, 2023

/kind bug

@JohnNiang 需要确认一下,我这边也出现了搜索到以前的文章,而且刷新索引无效。但重新初始化之后,没有出现删除文章之后还会搜索到的情况。

@f2c-ci-robot f2c-ci-robot bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 10, 2023
@JohnNiang
Copy link
Member

我在本地测试了一下,删除文章会更新索引,且无法再搜索到删除的文章。

图片

@zzudongxiang 建议删除文章后,查看一下日志是否存在异常。

@zzudongxiang
Copy link
Author

刚试了一下,设置为私有的文章也会出现在搜索结果中,请帮忙一起看一下

@zzudongxiang
Copy link
Author

我在本地测试了一下,删除文章会更新索引,且无法再搜索到删除的文章。

图片

@zzudongxiang 建议删除文章后,查看一下日志是否存在异常。

搜了一下我本地的Log, 删除文章的时候不是DEBUG模式,没有看到相关的Log

刚试了一下,设置为私有的文章也会出现在搜索结果中,请帮忙一起看一下

结合上面这个问题, 是不是在搜索的时候少了一个筛选条件导致这个问题

@JohnNiang
Copy link
Member

Hi @zzudongxiang ,更新索引的时机是:

  • 文章发布
  • 文章取消发布
  • 文章删除

如果删除文章的时候出错了,可能会造成索引未正确更新,导致查询出已删除的数据。

@ruibaby ruibaby added this to the 2.3.x milestone Feb 11, 2023
@ruibaby ruibaby added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Feb 11, 2023
@ruibaby ruibaby modified the milestones: 2.3.x, 2.4.x Mar 1, 2023
@ruibaby
Copy link
Member

ruibaby commented Mar 6, 2023

/assign @JohnNiang

@JohnNiang
Copy link
Member

/milestone 2.5.x

@f2c-ci-robot f2c-ci-robot bot modified the milestones: 2.4.x, 2.5.x Apr 3, 2023
@JohnNiang
Copy link
Member

刚试了一下,设置为私有的文章也会出现在搜索结果中,请帮忙一起看一下

该问题已经被修复,请看:#3438

@JohnNiang
Copy link
Member

/milestone 2.6.x

@f2c-ci-robot f2c-ci-robot bot modified the milestones: 2.5.x, 2.6.x Apr 28, 2023
f2c-ci-robot bot pushed a commit that referenced this issue May 9, 2023
#### What type of PR is this?

/kind bug
/kind improvement
/area core

#### What this PR does / why we need it:

This PR refactors post reconciler to reduce post updates and refines post events.

Previously, we need 3 - 4 updates per reconciliation, but now we only need 1. And all events collected in reconciler will be fired after updating post.

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

Fixes #3121

#### Special notes for your reviewer:

0. Install search plugin
1. Create a public post and publish it
2. Search posts
3. Try to make the post private
4. Search posts
5. Try to make the post public
6. Search posts
7. Try to delete the post
8. Search posts
9. Try to recover the post
10. Search posts

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

```release-note
修复依然能搜索到已删除文章的问题
```
@ruibaby ruibaby removed this from the 2.6.x milestone May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants