# 搜索结果列表在修改主题标题后截断了标题

**URL:** <https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499>\
**Category:** Bug\
**Created:** [2020年十二月7日 15:36 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499 "2020-12-07T15:36:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![amotl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amotl/32/109873_2.png) [@amotl](https://meta.discourse.org/u/amotl)\
**Post date:** [2020年十二月7日 15:36 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/1 "2020-12-07T15:36:39Z")

</div>

你好，

在调查 [Database migration chokes on huge value of a "calendar-details" item in table "post\_custom\_fields"](https://meta.discourse.org/t/database-migration-chokes-on-huge-value-of-a-calendar-details-item-in-table-post-custom-fields/172483) 的过程中，我们两次修改了该主题的标题，以更准确地反映我们对相关细节的研究原因和结果。

现在，当我们尝试使用 [Search results for 'calendar-details' - Discourse Meta](https://meta.discourse.org/search?q=calendar-details) 中的搜索功能找回该主题时，发现显示主题标题时存在截断现象。

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/8/286e84c8a21d0da20bd606bc6adf6b37f1f1d52f.png)

我之前从未见过这种情况，因此想与您分享。

请继续保持优秀的工作，顺祝商祺，  
Andreas。

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2020年十二月7日 19:22 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/2 "2020-12-07T19:22:00Z")

</div>

在 Meta 上，我们启用了隐藏站点设置 `use pg headlines for excerpt`，从而产生了此结果。这是一项性能优化，引入于：

> <https://github.com/discourse/discourse/commit/2193d0243377831caf96d8eaddb859813dae2bb0>

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2020年十二月7日 19:22 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/3 "2020-12-07T19:22:10Z")

</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:** [2020年十二月8日 01:39 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/4 "2020-12-08T01:39:51Z")

</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:** [2020年十二月8日 01:40 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/5 "2020-12-08T01:40:27Z")

</div>

在下一个版本中，`SiteSetting.use_pg_headlines_for_excerpt` 将默认为 true，因此我必须修复这个错误。

---

<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:** [2020年十二月21日 06:49 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/7 "2020-12-21T06:49:16Z")

</div>

我已提交了一个 PR 来修复此问题：

> <https://github.com/discourse/discourse/pull/11544>
>
> Need to apply the \`HighlightAll\` option in order to avoid topic titles
> from tru…ncated in headlines when displaying search results.

感谢 @amotl 的报告。

---

<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:** [2020年十二月22日 02:37 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/8 "2020-12-22T02:37:35Z")

</div>



---

<div class="post-metadata">

**Author:** ![cvx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cvx/32/152146_2.png) [@cvx](https://meta.discourse.org/u/cvx)\
**Post date:** [2021年六月8日 01:26 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/9 "2021-06-08T01:26:45Z")

</div>

> [@tgxworld](#):
>
> `SiteSetting.use_pg_headlines_for_excerpt` 将默认为 true

这仍然是计划中的安排吗？😃

---

<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:** [2021年六月8日 01:41 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/10 "2021-06-08T01:41:03Z")

</div>

是的，我需要在下一个版本中处理这个问题。

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2021年六月8日 03:09 UTC](https://meta.discourse.org/t/search-result-list-truncates-topic-title-after-amending-it/172499/11 "2021-06-08T03:09:43Z")

</div>

请注意，我们这里需要一些针对中文区域（我想）的绕过方案，因为它注入了大量空格。
