Search extension to combine WordPress and Discourse search results

AI-generated summary

The discussion revolves around creating a search extension to combine WordPress and Discourse search results. JagWaugh initiated the conversation, explaining that their site uses WordPress for static content and Discourse for forums, and that having a unified search would improve user experience.

Several solutions were proposed, including:

  • Creating a plugin to integrate WordPress’s API with Discourse’s search feature, as suggested by blake
  • Using a “search entire website” option, which would utilize a Google site search, as proposed by tophee
  • Posting WordPress resources as topics on Discourse, which could be automated using the WP-Discourse plugin, as suggested by pfaffman and pfaffman
  • Including the WordPress search box in an iframe on Discourse, as proposed by simon
  • Creating a pair of plugins, one for WordPress and one for Discourse, to allow for user-selectable inclusion of each site’s search results, as discussed by JagWaugh and simon

frold also inquired about the existence of a WordPress plugin that enhances the included search function to include forum posts.

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개의 좋아요

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개의 좋아요

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개의 좋아요

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

워드프레스 프론트엔드에서 검색할 때 포럼 게시물이 포함되도록 하는 솔루션이 있을까요?

워드프레스의 내장 검색 기능을 강화하는 플러그인 같은 것 말이죠… :grimacing:

1개의 좋아요