Exposing Ubuntu Forums content within Discourse

I would like to put my five eggs in here.
This thread has advocates of the advanced search properties in Discourse as compared to the UF format.
One of my particular interests is in HTPC using Mythtv. I just did a search on Discourse for Mythtv and it returned 4 articles, one of which is my own. A similar search on UF reveals well over a thousand posts on Multimedia with Mythtv representing the bulk of them. I did another search on Infra-red and no hits at all, on UF with 216 hits.

I ask would the moderators consider linking the search facility to the old UF site as there is a wealth of information that is very relevant today, not just for multimedia but almost every other topic.

I think this will ease the pain of transitioning to Discourse, and will encourage a much more engaging take-up of the site from newbies. The whole purpose of this site is to gather all the various disparate pieces of information on Ubuntu under one roof to simplify the take-up of all Ubuntu flavours and this would seem to be a simple way to help achieving this end.
Tony.

Just an FYI, but the message on login at Ubuntu Forums does include the text

For the time being forum members will be able to log in here for such tasks as accessing pm’s, or for forum searches, etc.

There are reason(s) for that text, in that the transition isn’t complete. Effort spent currently on searching both sites (even if possible) maybe very short term, and thus doesn’t make sense to me (at least until the transition is nearing a known/final state)…

1 Like

@guiverc No I disagree, I think the initial impression of Discourse to newcomers is of paramount importance if it is to become the UF replacement. Speed of enacting a common search is the key before much of the information becomes out of date.

The moderators are all volunteers.
Asking them to do a lot of extra research and work for drive-by suggestions (for free) goes over poorly.
So I assume you are offering to help research how this feature could be implemented.
That kind of help would be most welcome.

2 Likes

@ian-weisser Absolutely. If there is a way that I can be of use just point me in that direction and I’ll be very happy to assist. My skillset is not oriented towards software (although I did write my own service programme in DB3+ in 1986) electronics is my main bag, although at age 50 I went back to UNI and I did a three-year full-time course in networking and system administration. Anything I can do.
Tony

2 Likes

You’ve already got the pointer. In fact, you came up with it:

Now you need to figure out how to do it.

I think to imagine we’re going to change the codebase of Discourse to do this is unreasonable.

So that leaves us with two options:

  • A Discourse plugin.
  • Some external resource linked here (which will mean it’s not listed in the Discourse search itself). I think this is going to be hard if logins are required to search on UF.

Just thinking out loud - search bots have already catalogued the entirety of the UF posts, so perhaps an added query to the search facility to encompass information external to Discourse is all that is required.

For instance, if you Google anything to do with mythtv, it will return lots of hits on UF.

How you would go about achieving that is way beyond my field of expertise but I would think a couple of lines of code to include the major search bots would be able to accomplish such a task.

Then it is likely the case that you can’t help. Unless you search around and find a solution that already does that in a more general way.

I mean, here’s a simple solution; just replace “mythtv” with whatever you want:

https://duckduckgo.com/?q=mythtv+site%3Aubuntuforums.org&t=ffab&ia=web

That falls in the category of #2 above. We can link to it, but it’s not integrated with the search bar.

That’s going to be true with any external search facility you use.

…unless you have a Discourse plugin. That might be a good place to go researching.

2 Likes

I disgree. The old forum is like an old book which can be referenced through Wayback Machine for old tips which stand the test of time. TheFu’s ideas on backup for example.
But I admit that what I am now doing is building a front end tool (extension) to plugin to Albert to make custom searches and Ubuntu workflows. Not just for this watering hole but other forums. Using Albert the user can customise search patterns and workflows such as backups. Indeed this forum might consider developing some Albert plugins (not just Discourse plugins).

2 Likes

@dragonfly41 Pardon my ignorance but what exactly is “Albert”?

As I grok it, Albert’s a desktop launcher. So I think the idea would be to create a series of custom plugins for Albert that desktop users could use to search various services, including Discourse, Ubuntu Forums, etc.

Of course, there’s a problem: it’s not packaged for Ubuntu in any way. There’s no Debian package in the repos, no Snap package in the store, not even a Flatpak. Upstream has a Debian package repo, but that’s not really supported by anyone except the upstream developers, so we can’t really recommend it.

I did not realise that this is a constraint in introducing a higher level query. Discourse is not packaged by Ubuntu. As a example now … I hit the Albert trigger <Ctrl+Space> and up pops a query field above this discussion. I type ssh and the ssh syntax appears. And this is just one example. I think it better that I just work on a few examples. I did get banned in one forum Sublime Text for suggesting that it reminds me of Robot Gort’s “all seeing eye”. Some post flaggers need a sense of humour.

P.S. I should add that Albert does not work well with Wayland, only X11. This applies to other UI automation tools.

Maybe you’re missing the point here. The topic has branched off from the original, so it’s understandable. I’ll fix that momentarily.

I’ll say that your idea is an interesting approach. I wouldn’t mind using something like this myself as a general utility. It would ultimately solve the problem if you assume the software is already on the desktop and if someone bothered to make the plugins.

However, there’s two problems with this:

  1. For the reasons I gave before, Ubuntu can’t support it. Because we can’t support it, we can’t recommend it. We also can’t be expected to invest precious and limited time developing plugins for it. It’s a non-starter simply based on that.
  2. Back to the topic at hand, we’re discussing ways we can provide a window to Ubuntu Forums within the context of Discourse, not outside of it.

P.S. Actually, Discourse is packaged by Ubuntu… as a Charm.

2 Likes

I find Google works well. You just have to specify site:ubuntuforums.org and then the query words.

site:ubuntuforums.org Mythtv

I often did not save in my notes, and had to try to find an old post.

site:ubuntuforums.org oldfred Boot-Repair

but searches are finding many old thread, but you can use Google query to restrict dates.

1 Like

Now that is a great tip using Google search operators. oldfred & Boot-Repair are natural partners. Now I have to remember which old patterns might be useful.

TheFu rdiff-backup
dragonfly41 rEFInd
dragonfly41 Danny Kaye

Then add these to Albert repository for urlhandler repository.

My experience with Wayback is not good. Takes too long. This tip is much, much faster.

Another idea I have is to leverage Albert snippets plugin … clone it and use “snippets” directory to now “prompts” directory to hold “prompts” to my favourite AI assistant. That works well too. But the right choice of AI assistant is needed. this is the response I get from claude.io.

I don’t have specific information about using Albert for Ubuntu desktop automation as of my knowledge cutoff in October 2024. Albert is typically known as an application launcher for Linux systems (similar to Alfred on macOS), but I don’t have detailed information about its automation capabilities specifically.

But I get good results using phind.com.

The universe of AI assistants offers mixed results.

https://docs.google.com/spreadsheets/d/1czYc4u0XxNYuvwHJQ2EbiRHTqlJ-iomoDvUApgQDmBM/edit?gid=0#gid=0

I am in favour of writing “prompts”.

Phind.com: Recollect posts written in ubuntuforums.org which contain “oldfred” and “Boot-Repair” …

for example.

Still working on the idea of cloning existing Albert plugins. I am none too concerned that they must wear the Ubuntu livery. My queries go beyond Ubuntu.

@wxl
I have emailed Discourse with a request to see if such a plug-in exists or if they have a suggestion as to how to achieve these goals. I did have a look at their plugin offerings but nothing jumps out at me as being of much use to us.
If I get a response I will post it here.
Tony

@oldfred Hi mate, good to see you on here. The reason for this thread is to see if there is a way of implementing or incorporating a Google/DuckDuckGo search into the Discourse search facility.
Tony

I just did a ChatGPT query on this topic and these are the results:

Using the Discourse search facility, can the search incorporate a Google search at the same time?
ChatGPT said:

Discourse’s built-in search doesn’t natively support combining its results with Google search, but you can modify it to achieve this in a few ways:

  1. Modify the Search Interface (UI Approach)

You can add a “Search with Google” button next to the built-in search bar. This can be done via Discourse’s theme components by adding a link that redirects to Google with site:yourforum.com pre-filled.
Steps:

Go to Admin → Customize → Themes in Discourse.
Edit the theme component and add a button in the search bar template.
The button should redirect to:

https://www.google.com/search?q=site:yourforum.com+YOUR_QUERY

where YOUR_QUERY is dynamically replaced with the user’s input.
  1. Use a Plugin (Backend Approach)

A Discourse plugin could be developed to:

Query Google Search API alongside Discourse’s own search.
Merge results from both sources.
Display them in the search results dropdown or page.

This would require:

Access to the Google Custom Search API (paid if high-volume).
Modifying Discourse’s search controller to send dual queries.
Customizing the UI to display Google results alongside Discourse ones.
  1. Redirect Unsuccessful Searches to Google

Another quick workaround:

If no Discourse search results are found, show a "Try searching on Google" link.
Clicking it would redirect users to a Google search with site:yourforum.com.

Then:

Would you like help with code for a theme modification or guidance on a plugin?
You said:
Yes please
ChatGPT said:

Here’s how you can modify your Discourse theme to add a “Search with Google” button inside the search bar.
Steps to Add a “Search with Google” Button in Discourse Search

Go to Admin → Customize → Themes
Create a new Theme Component (or edit an existing one).
Add the following code to the Header (Common) section under "Edit CSS/HTML":

JavaScript (to modify the search bar UI)

Go to the “Header” section and add this:

  <p>No results found. <a href="https://www.google.com/search?q=site:{{window.location.hostname}}+{{searchTerm}}" target="_blank">Try searching on Google?</a></p>
{{/if}}

How It Works

This script adds a "Google Search" button inside the Discourse search bar.
When clicked, it opens a Google search with site:yourforum.com applied.
Users can still use the native Discourse search alongside this.

Alternative: Show a Google Search Link When No Results Are Found

If you want to show a “Search on Google” link when no Discourse results appear, modify the search_results.hbs template in a Theme Component like this:

{{#if no_results}}

No results found. Try searching on Google?

{{/if}}

This approach doesn’t require plugins and is easy to apply. Would you like any additional customization? :blush:

Probably a bad idea, as suggested before:

I think you answered the AI imprecisely:

You should have said “a plugin.”

Could a Discourse AI search plugin be enabled by admin team? Then we might experiment further with custom prompts.
It is true that wrong prompting can take the eye off the ball. Garbage in, garbage out principle applies. But I envisage a repository of carefully curated prompts.