Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a coding doc or tutorial to create a SEARCH where it search post in all Blogs in WPMU that will place in WPMU primary site SEARCH?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Take a look at WPMU Global Search plugin which can easily search through all blogs into your WordPress MU posts by post title, post content or post author.

and if you are not looking for a plugin then just take a look at the code and see how it's done.

share|improve this answer
    
I think you mean: wordpress.org/extend/plugins/multisite-global-search –  onetrickpony Jul 21 '11 at 9:17
    
probably, true but both work/ed on the multisite structure of the database so the Idea is mainly the same –  Bainternet Jul 21 '11 at 9:35
    
@Bainternet Thank you! it's great I can get idea in structure with this :) –  idontknowhow Jul 22 '11 at 0:35

The best approach is to create a "must-use" plugin that gathers post data when a post is submitted on any blog, and store it into a custom database table on the primary blog (and eventually delete it when a post is deleted).

For example hook a function on save_post that gets the post permalink, title, content or tags, number of comments, blog id, post id and stores them into a row of your custom table.

When someone does a search you pull out information from this table, instead of querying dozens of blogs.

You could use plugins like the one mentioned above, but these are not very good for larger sites. For example, I get around 10K queries using 1GB memory with "multisite-global-search" and that's just for a setup of 20 blogs with ~3000 posts. Needles to say it took 30 seconds to complete...

share|improve this answer
    
that's right thanks for the idea :) –  idontknowhow Jul 22 '11 at 0:34

I use google search with adsense. That works great if you setup the search to only search your domain. It will search all subdomains to

https://www.google.com/adsense

share|improve this answer
    
You can also use Google Custom Search to search your entire domain. –  Chris_O Feb 7 '12 at 19:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.