# 用第三方搜索栏替换搜索栏

**URL:** https://meta.discourse.org/t/replace-the-search-bar-with-a-third-party-one/201918
**Category:** Development
**Created:** [2021年八月27日 15:26 UTC](https://meta.discourse.org/t/replace-the-search-bar-with-a-third-party-one/201918 "2021-08-27T15:26:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![taraness](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taraness/32/232444_2.png) [@taraness](https://meta.discourse.org/u/taraness)
#### Post date: [2021年八月27日 15:26 UTC](https://meta.discourse.org/t/replace-the-search-bar-with-a-third-party-one/201918/1 "2021-08-27T15:26:21Z")

</div>

你好，

感谢点击此帖。我刚接触 Discourse，希望能得到一些指导。请问最好的方法是：

- 用第三方搜索栏替换 Discourse 自带的搜索栏
- 如果上述方法不可行，能否在主题的其他位置添加第三方搜索栏

我明白这可能不符合最佳实践，但只是想听听大家的看法。

非常感谢，  
Tara

---

<div class="post-metadata">

### Author: ![anon73664359](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@anon73664359](https://meta.discourse.org/u/anon73664359)
#### Post date: [2021年八月27日 15:31 UTC](https://meta.discourse.org/t/replace-the-search-bar-with-a-third-party-one/201918/2 "2021-08-27T15:31:48Z")

</div>

您在找类似这样的内容吗？

> [@Search with Bing/Yahoo/DuckDuckGo](https://meta.discourse.org/t/search-with-bing-yahoo-duckduckgo/138881):
>
> When you’re looking for a thread and no results are found, you’ll be offered to search using Google. I think that you should be able to change the search engine (in preferences) from Google to one of the other three “major” search engines. Maybe administrators could have the option to disallow users from changing the search engine? Maybe administrators could change the default search engine to Bing, Yahoo, or DuckDuckGo (or back to Google if they ever feel like it)? Feel free to ask for more i…

---

<div class="post-metadata">

### Author: ![taraness](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/taraness/32/232444_2.png) [@taraness](https://meta.discourse.org/u/taraness)
#### Post date: [2021年八月27日 15:47 UTC](https://meta.discourse.org/t/replace-the-search-bar-with-a-third-party-one/201918/3 "2021-08-27T15:47:27Z")

</div>

感谢您的回复！我测试了相关的主题组件，虽然它看起来很有趣，但并不是我想要的。我想完全用第三方搜索栏（不是 Google、Bing、Yahoo 等）替换 Discourse 的搜索栏。

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2021年八月27日 15:48 UTC](https://meta.discourse.org/t/replace-the-search-bar-with-a-third-party-one/201918/4 "2021-08-27T15:48:51Z")

</div>

[将 Algolia 搜索添加到您的 Discourse](https://meta.discourse.org/t/add-algolia-search-to-your-discourse/73517) 插件正是这样做的。您可以参考它获取灵感。
