# 主题过滤器未返回所有符合用户过滤条件的帖子

**URL:** <https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663>\
**Category:** Bug\
**Tags:** topic-filter\
**Created:** [2026年一月4日 23:34 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663 "2026-01-04T23:34:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)\
**Post date:** [2026年一月4日 23:34 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663/1 "2026-01-04T23:34:34Z")

</div>

我今天尝试查找一个主题，但使用主题筛选器时未能找到。我很喜欢可以根据参与者搜索主题的功能，我通常对参与者的记忆比对关键词更深刻，更适合用来搜索。

今天我搜索了我和 David 参与过的主题。我要找的主题是 [Do not show topics and PMs to admins unless they are participants](https://meta.discourse.org/t/do-not-show-topics-and-pms-to-admins-unless-they-are-participants/344065/?silent=true%E3%80%82)  
当它在筛选后的主题列表 [https://meta.discourse.org/filter?q=users%3Adavid%2Bmoin](https://meta.discourse.org/filter?q=users%3Adavid%2Bmoin) 中没有出现时，我以为是记错了，以为 David 不是我和他对话的那个人。但后来我在搜索中找到了该主题，才发现我没错。  
于是我想，也许使用筛选器时它被隐藏是有原因的。于是我给主题筛选器加上了分类 [https://meta.discourse.org/filter?q=users%3Adavid%2Bmoin%20category%3Afeature%20](https://meta.discourse.org/filter?q=users%3Adavid%2Bmoin%20category%3Afeature%20)，结果它出现了：

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/1/e/11e61e3bfead44cc4bc4d07453442e2e1bc5f10b.png)  
但一旦我移除分类筛选器，该主题就不会出现在筛选后的列表中：  
 ![image](https://global.discourse-cdn.com/meta/original/4X/b/5/9/b5982c4b8f6f5eb4bfe9cb6a7893b921022c57a6.png)  
最后活动时间在 2025 年 2 月的这个主题，理应排在 2025 年 9 月和 2025 年 1 月的主题之间。中间的空白就是“加载更多”发生的位置。因此，感觉当筛选结果超过 30 个主题时，某些功能似乎没有正常工作。

在撰写这份错误报告的过程中，我发现更改筛选器中用户名的顺序似乎会有影响。  
无论我以何种顺序输入用户名，前 30 条结果看起来都一样，但“加载更多”后加载的主题却不同。我高亮显示了第一条不同的内容。虽然左侧可以看到 9 月和 1 月之间的空白，但右侧的结果更令人惊讶。“加载更多”返回的主题，其活动时间比上方的主题更新。

| david+Moin\[1\] 标题 | 最后更新时间 | Moin+david\[2\] 标题 | 最后更新时间 |
| --- | --- | --- | --- |
| Locations Plugin 🌍 | January 4, 2026 | Locations Plugin 🌍 | January 4, 2026 |
| Daily Summary Feedback | January 4, 2026 | Daily Summary Feedback | January 4, 2026 |
| Topic List Previews (TLP) | January 3, 2026 | Topic List Previews (TLP) | January 3, 2026 |
| Topic List Thumbnails | January 2, 2026 | Topic List Thumbnails | January 2, 2026 |
| User Card Directory | December 30, 2025 | User Card Directory | December 30, 2025 |
| /about listing of Admins vs Moderators is confusing | December 29, 2025 | /about listing of Admins vs Moderators is confusing | December 29, 2025 |
| Winter snow theme component ❄ | December 23, 2025 | Winter snow theme component ❄ | December 23, 2025 |
| Clickable Topic | December 19, 2025 | Clickable Topic | December 19, 2025 |
| Topic Cards | December 18, 2025 | Topic Cards | December 18, 2025 |
| Discourse Who’s Online | December 16, 2025 | Discourse Who’s Online | December 16, 2025 |
| Toggling the \AI search discoveries\ preference doesn’t work | December 12, 2025 | Toggling the \AI search discoveries\ preference doesn’t work | December 12, 2025 |
| ActivityPub Plugin | December 10, 2025 | ActivityPub Plugin | December 10, 2025 |
| Discourse Advertising Plugin (Ads) | December 6, 2025 | Discourse Advertising Plugin (Ads) | December 6, 2025 |
| Discourse AI | December 4, 2025 | Discourse AI | December 4, 2025 |
| Link for old browsers doesn’t work on old browsers | December 1, 2025 | Link for old browsers doesn’t work on old browsers | December 1, 2025 |
| Sticky header gone | November 28, 2025 | Sticky header gone | November 28, 2025 |
| Unformatted Code Detector | November 21, 2025 | Unformatted Code Detector | November 21, 2025 |
| How to reliably & programmatically get the latest version number of Discourse? | November 14, 2025 | How to reliably & programmatically get the latest version number of Discourse? | November 14, 2025 |
| Discourse User Notes | November 14, 2025 | Discourse User Notes | November 14, 2025 |
| Discourse Topic Voting | November 13, 2025 | Discourse Topic Voting | November 13, 2025 |
| Discourse Solved | November 8, 2025 | Discourse Solved | November 8, 2025 |
| Bundling more popular plugins with Discourse core | November 4, 2025 | Bundling more popular plugins with Discourse core | November 4, 2025 |
| Discourse Category Headers theme component | November 1, 2025 | Discourse Category Headers theme component | November 1, 2025 |
| Missing PluginOutlet for second-factor.gjs component and for second-factor-add-totp.gjs | October 24, 2025 | Missing PluginOutlet for second-factor.gjs component and for second-factor-add-totp.gjs | October 24, 2025 |
| Latest topics missing from category view | October 15, 2025 | Latest topics missing from category view | October 15, 2025 |
| Discourse Category Lockdown | October 15, 2025 | Discourse Category Lockdown | October 15, 2025 |
| Multilingual Plugin 🌐 | October 7, 2025 | Multilingual Plugin 🌐 | October 7, 2025 |
| Post Badges | September 19, 2025 | Post Badges | September 19, 2025 |
| Discourse Affiliate | September 18, 2025 | Discourse Affiliate | September 18, 2025 |
| Developing Discourse on GitHub Codespaces | September 9, 2025 | Developing Discourse on GitHub Codespaces | September 9, 2025 |
| Login and Logout Errors from Cache Settings Conflict with Cloudflare | January 7, 2025 | Discourse Category Headers theme component | November 1, 2025 |
| Selectable avatars upload broken (Missing required UppyUpload config: id) | October 28, 2024 | Missing PluginOutlet for second-factor.gjs component and for second-factor-add-totp.gjs | October 24, 2025 |
| Can the Unformatted Code Detector be disabled per user? | July 31, 2024 | Discourse [Data Explorer](https://meta.discourse.org/t/32566?silent=true) | October 22, 2025 |
| Inconsistency in plural definition | July 29, 2024 | Latest topics missing from category view | October 15, 2025 |
| New topic map causing infinite-loading loop | July 26, 2024 | Discourse Category Lockdown | October 15, 2025 |
| Issue with pluralized (count) translation override | July 22, 2024 | Multilingual Plugin 🌐 | October 7, 2025 |
| Bad MF translation string in hebrew client locale causes fatal site error | July 22, 2024 | Creating a component to show last-chance warning when replying to old topics | October 6, 2025 |
| TOC missing after using browsers back button | January 25, 2024 | Post Badges | September 19, 2025 |
| Title of /tag/xxx | December 4, 2023 | Discourse Affiliate | September 18, 2025 |
| Browser Back -function occasionally broken on Android | November 27, 2023 | Discourse Docs | September 16, 2025 |
| Tag information issue | November 20, 2023 | Developing Discourse on GitHub Codespaces | September 9, 2025 |
| Topic preview of pinned topic disappears | November 7, 2023 | Install Discourse for development using Docker | September 8, 2025 |
| Please don’t double link urls if one pastes over a URL in markdown | December 3, 2021 | Add tags with capital letters | September 7, 2025 |
| | | Discourse Templates | September 2, 2025 |
| | | Advanced Header Search | August 27, 2025 |
| | | Third-party plugin repository hijacked | August 19, 2025 |
| | | New header dropdown / notification menu styles | August 13, 2025 |
| | | Text color field for categories missing after update | August 8, 2025 |
| | | Custom Homepage for Groups | August 6, 2025 |
| | | Option to hide IP addresses from moderators | August 6, 2025 |
| | | Inconsistent behavior with `chat max direct message users` setting | August 5, 2025 |
| | | Custom Header Links (icons) | August 4, 2025 |
| | | What are good plugins or theme components for a forum emphasizing pictures? | August 4, 2025 |
| | | Downloading local copies of images should not change text in code blocks | August 2, 2025 |
| | | EmojiPicker missing in mobile chat | August 1, 2025 |
| | | 最新版更新出错 | July 28, 2025 |
| | | \Thanks for Contributing\ Popup in Posts Appearing Even After Limit Passed? | July 17, 2025 |
| | | New Discourse Lightbox Enabled on Meta - now disabled | July 12, 2025 |
| | | Announcing: AI Web Artifacts | June 27, 2025 |
| | | Discourse-tag-sidebars and deprecated inline script tags | June 20, 2025 |

* * *

1. [https://meta.discourse.org/filter?q=users%3Adavid%2BMoin](https://meta.discourse.org/filter?q=users%3Adavid%2BMoin) 

2. [https://meta.discourse.org/filter?q=users%3AMoin%2Bdavid%20](https://meta.discourse.org/filter?q=users%3AMoin%2Bdavid%20)

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2026年一月5日 07:22 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663/3 "2026-01-05T07:22:41Z")

</div>

感谢您的报告！

> [@Moin](#):
>
> 我发现更改过滤器中用户名的顺序似乎很重要。

这是因为目前存在一个错误，我们在构建“加载更多”URL时会对查询参数进行解码。这在下游导致了问题，即在加载更多内容时，`users:` 过滤器中只有第一个用户名被用来过滤主题。

这已在以下链接中修复：

> <https://github.com/discourse/discourse/pull/36954>
>
> \### What is the problem?
> 
> With the \`unicode\_usernames\` site setting enabled, L…istController unencoded the full URL returned by the path helper. That also unencoded the query string, so filters like \`users:foo+bar\` lost the URL encoding in \`more\_topics\_url\`, which broke loading more topics for /filter.
> 
> \### What is the fix?
> 
> Only unencode the URL path by parsing with \`URI\` and applying \`UrlHelper.unencode\` to \`uri.path\` only.

---

<div class="post-metadata">

**Author:** ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)\
**Post date:** [2026年一月5日 07:44 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663/4 "2026-01-05T07:44:49Z")

</div>

> [@tgxworld](#):
>
> 这在下游导致了问题，即 `users:` 过滤器中仅使用第一个用户名来过滤加载更多时的帖子。

这难道不会总是比搜索两个用户都参与的帖子产生更多的结果吗？所以当我搜索“david+moin”参与的帖子并加载更多时，加载的是 david 参与的帖子，那么我搜索的帖子不应该仍然在返回的帖子列表中，因为 david 参与了它吗？

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2026年一月5日 07:58 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663/5 "2026-01-05T07:58:11Z")

</div>

> [@tgxworld](#):
>
> 仅在加载更多内容时使用了 `users:` 过滤器中的第一个用户名来过滤主题。

好的，我明白了。`users:moin+david` 查询参数在加载更多内容时会变成 `users:moin david`。它正在搜索包含 `david` 术语的主题中 `moin` 发表的帖子。

我目前的修复将解决这个问题。

---

<div class="post-metadata">

**Author:** ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)\
**Post date:** [2026年一月5日 21:57 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663/7 "2026-01-05T21:57:58Z")

</div>

运行良好。谢谢你

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2026年一月19日 00:00 UTC](https://meta.discourse.org/t/topic-filter-does-not-return-all-posts-matching-the-users-filter/392663/8 "2026-01-19T00:00:04Z")

</div>

此主题在 13 天后自动关闭。不再允许新的回复。
