The MU forums have moved to WordPress.org

Search across multiple blogs (18 posts)

  1. simplestation
    Member
    Posted 17 years ago #

    So here's a question. With Wordpress MU installed, are there any plugins that will allow you to search across multiple blogs.

    For example, if I have two blogs, one called personal, and one called business, can a user type a query in the search field of one blog, and be returned results from a combination of both blogs?

    I looked at phpDig as an option to providing this, but I'm wondering if there is something already written to this effect.

  2. andrea_r
    Moderator
    Posted 17 years ago #

    The google search widget, when placed on the main blog, searches all blogs on the system.

  3. Farms2
    Member
    Posted 17 years ago #

    Yep, google 'tis the answer (try it live on edublogs.org)

  4. quenting
    Member
    Posted 17 years ago #

    Same here... Although once you have a global post cache table, that may be a good solution too.

  5. simplestation
    Member
    Posted 17 years ago #

    So where can you get the code for this Google search widget?

  6. andrea_r
    Moderator
    Posted 17 years ago #

    It's included in the Widgets plugin.
    http://automattic.com/code/widgets/

  7. suleiman
    Member
    Posted 17 years ago #

    personally I dislike the google widget option.

    It takes my users away from my site, which is generally a bad thing.

    I also have a global posts table which I want to leverage. So coding a proper search doodad should be easy to do.

    Time to hit the codex I guess!

  8. quenting
    Member
    Posted 17 years ago #

    you can default the google search to search your site. I don't use the widget personnally, just the main site has a global google search.

  9. zeug
    Member
    Posted 17 years ago #

    I've been using iSearch2 on one of my Mu's and it's quite handy. I just include the main blogs header, sidebar and footer in index.php, modify the look of the search page in site css, then set some simple regexp to control the search results.

    It uses mySQL and cron, has language support and a current userbase, and there are apparently a few 50 000+ page sites using it so it seems robust.

    I haven't populated the Mu yet so I haven't seen how far iSearch can go but you can see it in action here.

  10. suleiman
    Member
    Posted 17 years ago #

    zeug I've been trying to get iSearch2 to work on my site, running into a few bumps on the way.

    I think that it must be a redirects issue, but despite the isearch2 tables being created in my wpmu database, the spyder comes back with 0 results every time I try and index.

    Did you do anything special to get it working? I took note of the .htaccess file in the /isearch2/ directory, but opted to leave it alone.

  11. ColinFilmJournal
    Member
    Posted 17 years ago #

    I've written my own search function - however, it's not a quick thing to do.

    First up I have a CRON job which collates all of the sites posts and comments and then updates three tables - one for comments, one for posts and a general blog table. This makes cross-site searching much easier.

    Then I've put together a new page 'wp-search.php' at the root level which searches these tables based on the term entered and returns the results within the site itself :)

    You can see it working here:

    http://filmjournal.net/wp-search.php

    I use the same tables to display the latest posts and comments on the front page without any huge server load being added by a massive UNION select statement.

  12. suleiman
    Member
    Posted 17 years ago #

    Colin, I love the setup that you're using, it's exactly what i'm looking for except that I don't particularly care for comments to be searchable right now.

    I already have posts being pulled into a global posts table, so I would be interested to get a look at your wp-search.php file if you don't mind posting it in a zip file?

    Very sleek site btw, I love the design.

  13. ColinFilmJournal
    Member
    Posted 17 years ago #

    Send me an email to colin@filmjournal.net and I'll forward the file to you.

  14. suleiman
    Member
    Posted 17 years ago #

    sent :)

  15. andrea_r
    Moderator
    Posted 17 years ago #

    Colin, would you consider uploading it to wpmudev.org, and sharing it with the community?

  16. ColinFilmJournal
    Member
    Posted 17 years ago #

    I am planning to - need to strip it down and take out things specific to my site first otherwise no-one will understand it :D

  17. ColinFilmJournal
    Member
    Posted 17 years ago #

    I'll also include the scheduled job to pull all of the posts and blogs into a few tables - but this requires a recent version of MySQL that supports union statements.

    I'll put together a ZIP with everything in and upload it next week :)

  18. psenthilraja
    Member
    Posted 16 years ago #

    Hi Colin,

    Your solution seems to be very useful. However, i have the following issues over this.

    1. When we maintain separate table for collation, doesnt it means, we are doubling the database size? What will be the implications when the number of blogs increases

About this Topic

  • Started 17 years ago by simplestation
  • Latest reply from psenthilraja