Search extension to combine WordPress and Discourse search results

Many sites combine Discourse and Wordpress. We use Wordpress to store static info like ebooks and model guides, as well as user photo albums.

Would it be a huge job to extend the discourse search to include the Wordpress site? Perhaps this would be better as a plugin.

What I’m observing is that someone asks “I tried searching for info on how to do job X, but didn’t find anything. How do I do this?” on the forum. If they’re lucky, one of the old hands will reply “There’s a photo essay on how to do it at Y” which points to a URL on our static site.

I can reply, or add “Don’t forget to search the static site” to all the guides and FAQs I want. If Search could also include hits from the static site then that would be more streamlined.

1 Like

Not that this is the perfect solution, but you could offer two searches: “search forum” and “search entire website” (the latter would be a goggle site search)

Yes this would need to be a plugin of some kind. Wordpress has an API, so I would start with seeing if you could make an api call to the search endpoint. Then in your plugin I’m sure you could hook into the search feature and add the results of your wordpress call.

3 Likes

A solution that would involve almost zero programming and no change to Discourse would be to WordPress resources all post their own topics to Discourse. You might tweak the post to include some reasonable summary of the resource.

1 Like

I was thinking the same, but that wont work so well with

It wouldn’t do full-text search of the ebooks, guides and photo albums, , but I’d think that the pages in question include enough information to make such topics good enough for the search.

Generally, yes. I’ve even considered adding a post on discourse with the keywords, and a link to the item on the static site, but that’s a bit… manual. one post per resource and model guide.

I don’t want to add a “Don’t forget to check out the static site…” text to the discourse search.

You can get the WP-Discourse plugin to post them all for you. I think you’d need to do something to trigger getting it to make posts on existing WP pages, but I think I’ve seen complaints that it was re-posting when people didn’t expect it, so it can’t be too hard. :slight_smile:

An easy solution that might work would be to include the WordPress search box in an iframe.

We could do that. I was thinking of something more streamlined. like an “Include WP Site in search” checkbox.

The distinction between the “Static” site and the “forums” is clear to me, and we’ve a menu bar across the top of the page… but from the user’s perspective, it’s all one site, and that magnifying glass is the search so… if they don’t get any hits with that then there must not be anything on the site.

I would like to add something like that, but the opposite (“Include Discourse forum in search”), on the WordPress end.

I guess you’d need a pair of plugins?

On Wordpress:

Allow searches from: forums.myintegratedsite.org
Also search website: forums.myintegratedsite.org

On Discourse:

Allow searches from: myintegratedsite.org
Also search website: myintegratedsite.org

Making the inclusion user selectable would be smart

Did someone make a solution when searching on you wordpress frontend it includes forum posts?`

A wordpress plugin or something that enhance wordpress included search function… :grimacing:

1 Like