DuckDuckGo Search Suggestions

Solves Is there a way to suggest DuckDuckGo instead of Google for failed search UI?.

A Discourse theme component to use DuckDuckGo as the suggested search system, instead of Google!

p.s. You’ll probably want to customize some of the text strings to stop mentioning Google, too.

18개의 좋아요

Here’s what I’ve noted to be the places to alter the text:

  • js.search.or_search_google
  • js.search.search_google
  • js.search.search_google_button
  • page_not_found.search_google
    • is that search also adjusted to DDG in the theme? If not, that should be fixed too
  • js.google_search
    • that looks like it’s editable to put in DDG directly, not sure how that’s related

Is that it?

2개의 좋아요

Okay, I’m writing this down, because 404 handling in Discourse is weird. Try this link on for size:

https://meta.discourse.org/nonexistant-page

If you open it in a new tab, you’ll notice that your user menu (the one in the upper-right of the page) doesn’t render. In fact, the Discourse Ember app doesn’t get loaded at all in this case. It’s being rendered by the Rails server following app/views/exceptions/not_found.html.erb

Obviously, if you click the link directly in this page, the Ember app remains resident. Try hitting the link with a .json at the end, and instead of sending the app a full 404 page, it sends an HTML fragment, with the heading and stuff removed, which the Ember app just plops into place.

2개의 좋아요

Oh weird. But if that’s less trivial to fix, at least it can be documented and the easier parts all fixed. Thanks for working on this!

1개의 좋아요

https://github.com/notriddle/discourse-duckduckgo-search/commit/17c849c5b8c22476720a07ee7ebfa4536feecedc

Added a commit to do the form rewriting to make the 404 page work, both within and without the Ember app.

5개의 좋아요

Great! So the only remaining thing is to document (probably both here and at the repo README) the confirmed list of text items theme-users will need to customize in the admin UI?

1개의 좋아요

I got this working, but it’s a little strange to have the page-not-found version start with the form using site:xxx… with no search term alongside that. Maybe that’s as good as it gets, but it would be ideal if it were feasible to get the text of the URL after the TLD for the not-found page and use that as the default search before the site: part…

Given

Google is no longer used at 404 pages. So, this theme probably needs updating to leave 404 pages alone, let them be the regular internal search as is now standard.

Discourse is still using Google for extra searching when internal searches fail though. So, for that, this DDG option still applies.

3개의 좋아요

It wasn’t actually breaking anything, but I did go ahead and revert it. It also made the code simpler, since I can just replace the template again.

https://github.com/notriddle/discourse-duckduckgo-search/commit/39e5501c35f2b73dd3eb9a7977de0c472d85711c

6개의 좋아요

추가 검색이 발생할 때, 왜 Google이 여전히 Discourse의 기본 검색 엔진으로 설정되어 있는 이유가 있나요? DuckDuckGo가 Google보다 Discourse의 마인드셋에 더 잘 부합한다고 생각합니다.

4개의 좋아요

동의합니다. 현재 우회 방법이 있나요?

Discourse AI와 함께 사용할 수도 있을 것 같아요 :slight_smile:

1개의 좋아요

이 테마 컴포넌트 그 자체가 우회 해결책입니다.

3개의 좋아요

이 주제를 몰랐고 테마 컴포넌트에 대해서도 알지 못해서, 그냥 구글 검색 기능을 통째로 제거해버렸습니다… 하지만 이제 또 다른 비공식 테마 컴포넌트를 추가하는 것은 꺼려집니다. 기본값이 DuckDuckGo이거나 사이트 설정이 있을 수 있다면 좋겠습니다.

1개의 좋아요

…즉, 제공자를 변경하거나 이 폴백 검색 제안을 완전히 제거할 수 있도록 하는 기능 말이죠.

그동안, 당신은 어떻게 "검색 기능을 완전히 제거"하셨나요? 아마 테마 컴포넌트를 만들었을 텐데, 여기 실제 코드를 공유해 주시겠어요(제가 직접 찾아내지 않아도 되도록)?

포크를 해서 URL을 변경했습니다. 일반적인 표준은 빈 값으로 두고 사용자가 직접 변경할 수 있도록 하는 것입니다.

마케팅은 바로 이런 방식으로, 가장 미세한 수준의 사회공학(Social Engineering)을 통해 깊이 있게 작동합니다.

플러그인 아웃렛을 사용하도록 업데이트를 푸시했지만, 이 기능은 Discourse 자체에 아웃렛이 추가되어야 합니다.

7개의 좋아요