# 用户搜索总能找到自己

**URL:** https://meta.discourse.org/t/user-search-always-finds-self/347065
**Category:** Bug
**Tags:** user-directory
**Created:** [2025 年1 月 14 日 13:31 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065 "2025-01-14T13:31:12Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### 作者： ![tkforbes](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tkforbes](https://meta.discourse.org/u/tkforbes)
#### 发布日期： [2025 年1 月 14 日 13:31 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/1 "2025-01-14T13:31:12Z")

</div>

使用更多 → 用户时，当找到筛选匹配项时，列表 **始终** 包含执行搜索的用户。当没有匹配项时，列表为空，即无匹配项时条目为零，有匹配项时条目为 2 个或更多。已使用多个用户帐户进行测试 - 结果相同。

 ![Screenshot from 2025-01-14 07-57-52](https://global.discourse-cdn.com/meta/original/4X/8/e/4/8e4f1bd8c94414407bb5ef591348268429d902c8.png)

我这个周末进行了升级。不确定是与此相关的新问题，还是之前就存在的情况。上次升级大约在圣诞节，肯定没有注意到这种不当行为，所以我认为这是最近才出现的。

---

<div class="post-metadata">

### 作者： ![tkforbes](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tkforbes](https://meta.discourse.org/u/tkforbes)
#### 发布日期： [2025 年1 月 14 日 13:37 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/2 "2025-01-14T13:37:30Z")

</div>

Confirmed same here on meta…

 ![The image shows a screenshot of user statistics from a Discourse forum for the week of January 8 to January 14, with information on replies posted, received, given, and viewing topics. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/3/d/1/3d18975cd30c4405b73a9f6c02d1f08c6222b5f6.png)

---

<div class="post-metadata">

### 作者： ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### 发布日期： [2025 年1 月 14 日 13:39 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/3 "2025-01-14T13:39:12Z")

</div>

我认为一直都是这样

> [@User search always has myself](https://meta.discourse.org/t/user-search-always-has-myself/311948/2?u=moin):
>
> I think that’s by design. Though if you’re using the [User Card Directory](https://meta.discourse.org/t/user-card-directory/144479) theme component there’s the hide current user setting which may be of use to you?

---

<div class="post-metadata">

### 作者： ![tkforbes](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tkforbes](https://meta.discourse.org/u/tkforbes)
#### 发布日期： [2025 年1 月 14 日 15:40 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/4 "2025-01-14T15:40:55Z")

</div>

我感谢您指出了相关主题。但是，该主题中的回复说“我认为这是设计使然”。这只是一个想法，而不是解释。对我来说，我报告的行为是违反直觉的。如果这不是一个错误，我想了解为什么当前的行为是期望的/设计行为。我自己想不出一个很好的理由。

---

<div class="post-metadata">

### 作者： ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### 发布日期： [2025 年1 月 14 日 16:33 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/5 "2025-01-14T16:33:40Z")

</div>

用户目录也是一个活动排行榜，因此始终显示您自己的帐户可以轻松比较统计数据。

我相信这也是为什么我们在未过滤列表的顶部再次显示当前用户，除了在列表下方自然放置之外，这样您就不必无休止地滚动或过滤来比较您自己的统计数据。

---

<div class="post-metadata">

### 作者： ![tkforbes](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tkforbes](https://meta.discourse.org/u/tkforbes)
#### 发布日期： [2025 年1 月 14 日 16:38 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/6 "2025-01-14T16:38:06Z")

</div>

谢谢。类似那样的事情，我能理解。而且这个逻辑与在过滤列表中用颜色突出显示自己是一致的。我只希望当用户问起来的时候我能记得住。

---

<div class="post-metadata">

### 作者： ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### 发布日期： [2025 年1 月 14 日 16:44 UTC](https://meta.discourse.org/t/user-search-always-finds-self/347065/7 "2025-01-14T16:44:00Z")

</div>

有点复杂，但如果你想添加一些 CSS（管理员 \> 自定义 \> 主题）来禁用过滤结果中的此行为……这是可能的：

```css
.directory:has(.filter-name:not(:placeholder-shown)) .me {
  display: none;
}

```

这基本上意味着“如果目录过滤器没有显示占位符（即已输入术语），则不要在结果中显示我的帐户”。

但请注意，这也将从_匹配_的过滤器中删除你自己，所以这是一个不完美的解决方法。
