Wulf

wpSearchMu enables sitewide search over an entire WordPress Mu installation. It is an offshoot of the excellent wpSearch plugin, just extended to work for Mu instead of only ‘normal’ wordpress.

wpSearchMu replaces the default WordPress search with the open source Lucene search engine. This allows unparalleled result accuracy for your blog. With wpSearchMu, you can specify settings on a per blog level. This means that your root blog can be setup to search the entire Mu site, while each individual blog can be set up to search only itself (or any combination of blogs).

Current Version: 1.1.2

Download it here: Download It HereWP Search Mu Plugin 1.1.2

More Info and Source Code

I just set up a repository at the generous wordpress.org site. Check out the wpSearchMu page for more info.

To download the source for your hackering pleasure, just type:


svn co http://svn.wp-plugins.org/wpsearchmu wpsearchmu

Installation

  1. Upload the wpSearchMu zip to your mu-plugins directory and unzip it. You should be left with a wp-search-mu.php and a wp-search-mu directory in the mu-plugins folder.
  2. Next, you’ll need to configure your search index options, and then build the full search index. Building the index may take a few minutes but you should rarely need to do this more than once.Also, so that Lucene can create the search index, you’ll need to set the permissions of the wpsearchmu directory to full permissions. From the root directory of your WordPress installation:
    
    chmod -R 777 wp-content/mu-plugins/wp-search-mu/
    
  3. After that, you’ll want to update your search.php to work with wpSearchMu’s search results.

Theme integration

You’ll need to update your search.php to work with results from more than one blog. At the beginning of the Loop, add:


switch_to_blog($post->blog_id);

and at the end, add:


restore_current_blog();

After your done, your search.php should look something like:


<?
while (have_posts()) : the_post();
switch_to_blog($post->blog_id);
?>
<h2><a href="<?php the_permalink() ?>"></a></h2>
<div class="entry">

<a href="<?php the_permalink() ?>">Read more...</a></div>
<?
restore_current_blog();
endwhile;
?>

Also! If you want to query the index outside of the normal WordPress search.php file, then you can do that too! Have a look at the following code for how to query the search index of a particular blog.


// switch to the blog who's index you want to use
switch_to_blog(3);
$index = wpSearch_createIndexObject(false);
$s = "my search terms";
// get the results from the lucene index
$lq = "post_title:($s) post_content:($s) post_name:($s)";
$query = Zend_Search_Lucene_Search_QueryParser::parse($lq);
$hits = $index->find($query);

// interate over the results
// and output some HTML
$posts = array();
$count = 1;
foreach($hits as $hit){
$post = WPSearchResult::BuildWPResultFromHit($hit);
$posts[] = $post;
the_title();
echo "<br>";
}
restore_current_blog();

Before and After

Search accuracy was dramatically increased after installing wpSearchMu. Below is a sample screenshot showing the top result for searching my blog for “columnizer”. Default WordPress search on the left links to an unrelated post. The results on the right show wpSearchMu correctly linking to Columnizer’s project page.

Before and After

wpSearchMu Settings

Below is a summary of all the available options for wpSearchMu.

1. Index and search only want you want.

you can setup wpSearchMu to index every blog in your Mu install, or only certain blogs. You tell it to search only a specific list of blogs, or everything except a certain list of blogs.

2. Boosting / Weighting

‘Boosting’ one field higher than another will make that field more important in searches. Usually, the title is the most important thing to match in a search, but that’s up to you. Setup field weights to match what you think is important. You can setup custom weights not just for the title and body of a post, but for custom fields as well! Which brings us to…

3. Searching comments

One pitfall of WordPress’s default search is that it doesn’t also search comments. With wpSearchMu, you can optionally index all comments as well, not just posts and pages.

Wishlist

1. Searching custom fields

Have any important data tucked away in custom fields? I do! that’s why I extended wpSearchMu to include the ability to search custom fields.

FAQ

1. Why wpSearchMu?

wpSearchMu stands apart from Google CSE, OneSearch, and others, in that it’s based on the open source Lucene search engine, which yeilds much more accurate results compared to OneSearch. Unlike the Google search, it’s 100% tweakable, customizable, and doesn’t show unwanted mandatory ads.

2. What’s Lucene, and what’s a search index?

Lucene is an open source search engine/platform/framework that lets you index and search just about any data you put into it. A search index is just that, an index! like at the back of a book that lists the pages each word is on, Lucene’s index lets you quickly get the post, page, or comment from a given search query.

3. Can I index only certain blogs?

wpSearchMu lets you index all, some, or just one of the blogs in your Mu site. You have complete control over which blogs are included in your search index.

4. Can wpSearchMu be installed on just the root blog? or does it have to be installed on every blog?

The wpSearchMu plugin can be activated on any and every blog in the Mu installation, not just the root blog. You have complete control over which blogs wpSearchMu is activated on.

Not only that, but for each blog that wpSearchMu is installed on, the blog owner can decide which blogs to include in it’s search results. This means that, for every blog on the site, search results on their blogs search page to return results just from their own blog, or from some subset of blogs, or from every blog in the system.

As an example, I’ve installed wpSearchMu on my root blog and set it up to return results from the main blog and from /notes/. I’ve also setup the /bookmarks/ blog to only search bookmarks. Both of these searches are powered by wpSearchMu.

Changelog

For a complete list of what’s changed in each version, check out the full changelog.

154 Comments

154 responses so far ↓

  • 1 Landy // May 28, 2009 at 5:39 pm

    Going to try this now!!! I hope it works!!

    THANKS!
    LK

  • 2 Adam Wulf // May 28, 2009 at 7:13 pm

    Just found a pretty sizable bug that i’m not sure how i missed the first time around. I updated the .zip download with the fix, so re-download and re-index and you should be good to go.

    cheers :)

  • 3 Landy // May 29, 2009 at 10:19 am

    Hey Adam, I must say this is great work!!
    Is there any chance that you will be adding categories into the search features?

    Thanks,
    LK

  • 4 O // May 29, 2009 at 12:59 pm

    I have had a difficult time searching with this plugin. I have not been able to get any search results. I have installed properly but I get empty result sets. I have re-indexed, re-installed but still am not getting any search results. I have 15 blogs on my install do I need to do theme integration on each of them? I’ve tried integrating on two of them and still have no results. Please advise.

  • 5 Adam Wulf // May 29, 2009 at 5:00 pm

    @O

    make sure your directory is chmod’d to 777 and that the index directory exists. you should see the following directories when you re-index a blog:

    wp-content/plugins/wpsearchmu/data/blog_id

  • 6 Landy // May 29, 2009 at 5:04 pm

    Hey Adam, after playing around with the search a little more it seems that I can not search with a authors name. I looked into the code and it seemed like that it should be able to do this.

    I tried adding
    $author_query = “post_author:($q)”;
    to the query function but that didn’t seem to help. If you have any comments / ideas that would be great.

    Thanks,
    LK

  • 7 O // May 29, 2009 at 5:26 pm

    @Adam Wulf
    Ok I started from scratch: I installed, then 777′d then I went to my first blog and indexed. The data file showed up. I thought that this would index all of my blogs at once? I then went to a second blog and did the same and got the data file (with 4 files inside). As a test I copied one of the titles from the blog and got an empty result set. I then searched “hello world” which is in all of my blogs and again nothing!

  • 8 O // May 29, 2009 at 5:30 pm

    Oh and yes, Dr. Antinori is really creepy!

  • 9 Adam Wulf // May 29, 2009 at 6:28 pm

    Landy,

    i’m pretty sure it’s indexing the author id instead of the author name, so searching for a name isn’t matching. i’ll put that on my todo list, along with category search.

    O,

    strange that you only have 4 files, i get 11 files in my index… something’s going wrong during the index apparently. i’ll poke around with it tonight/tomorrow and try and reproduce what you’re seeing. any other plugins, especially search related plugins, installed?

  • 10 O // May 29, 2009 at 6:44 pm

    yes I have “one search” in my mu-plugins folder which I just removed. Every step is going well until I actually execute a search.
    the files I see are:
    write.lock.file
    segments_1
    segments.gen
    read.lock.file

  • 11 O // Jun 1, 2009 at 4:29 pm

    Any thoughts anyone?

  • 12 Adam Wulf // Jun 2, 2009 at 2:20 am

    O, I’ll should have an update late tomorrow. i had hoped to get it done this weekend, but travel + errands took up too much of my time :/

  • 13 IndiaPoint // Jun 2, 2009 at 8:39 am

    Simply the Best - users delight.

  • 14 IndiaPoint // Jun 2, 2009 at 8:59 am

    While it seems to work - ie. it has properly rendered the authors and the list of posts. For example on my site if you search for “wordpress” (from homepage)- there are four posts that pop up - which is correct as can be viewed from the name of authors - HOWEVER - the LINKS are WRONG. What is the remedy?

  • 15 IndiaPoint // Jun 2, 2009 at 10:05 am

    Sorry to write again - but is it necessary to write the two lines in the search.php - is it for proper links or is it for theme integration only?

    Also, where is this search.php ? Is it a theme file or a regular wordpressMU file?
    thanks

  • 16 O // Jun 2, 2009 at 11:20 am

    Thanks!

  • 17 Adam Wulf // Jun 3, 2009 at 4:23 am

    O, i just uploaded a new version. this one installs in mu-plugins instead. also be sure to deactivate any other search related plugins. lmk how it goes!

    indiapoint, the links are wrong b/c your search.php isn’t updated. the search.php /must/ be updated for the links to work. look in your theme’s directory and you should see it.

    Cheers!

  • 18 O // Jun 3, 2009 at 2:30 pm

    Thank you for the update. I have installed and still am not getting results. I am still getting the same 4 files:

    read.lock.file(file size: 0)
    segments.gen(file size: 20)
    segments_1(file size: 20)
    write.lock.file (file size: 0)

    The dialog tells me:
    Rebuilding index with comments … Complete

    wpSearchMu is properly configured and indexed. All searches on this blog use wpSearchMu instead of the regular WordPress search.
    But when I search for a title that is in that blog no results. I have deleted any other search file out of the mu-plugins folder.

    The issue seems to be that “if (have_posts())” always fails in the search.php and my “get_header()” is returning NULL. This only happens if I turn on wpSearchMU. Do you have any clues as to why this is?

  • 19 Adam Wulf // Jun 4, 2009 at 2:47 am

    O, change KLogger:OFF to KLogger:DEBUG in wpSearch.php, then look at log.txt to see if anything looks suspicious.

    Also, confirm that “is_search() && wpSearchIsIndexBuilt()” is true on line 189, and that the search is actually being run against the index.

  • 20 Ray // Jun 6, 2009 at 2:27 pm

    I’m new to WPMU, not new to WP.

    Though I must be daft because I can’t figure out how to build the initial search index options. I’m probably overlooking something very simple!

    Any help here?

  • 21 Adam Wulf // Jun 6, 2009 at 5:08 pm

    Ray, in the Settings -> WP Search Mu screen, enter the blog ids that you want to index (or leave empty to index the entire site), then click the checkbox next to Build Search Index and optionally next to Enable Comment Searching. Then click Save Settings at the bottom.

    It’ll take between a few seconds to a few minutes, depending on the size of your site, and then you should see a “wpSearchMu is properly configured and indexed” message at the top of the screen.

    Hope that helps!

  • 22 Ray // Jun 6, 2009 at 10:08 pm

    Hi Adam,

    Thanks for those easy instructions. I was looking for wpSearchMu under “Site Admin”, instead of the regular “Settings” menu.

    I still have some ways to go before I’m up to speed with MU!

    Follow-up questions for you.

    If I do not update the “search.php” file, that means MU will still use the default Wordpress search right?

    I think I might use a select option dropdown for the search, so that users will have the option to search the blog they are currently on or the entire site.

    If I were to do such an option, I’d probably have to edit the searchform.php file.

    Is there some type of PHP code I could use on the searchform in order to let wpSearchMu distinguish the type of search?

    A hidden input value perhaps?

    I’m not sure if this is possible.

    Thanks for reading!

  • 23 Sahar // Jun 10, 2009 at 10:31 am

    Hi there,
    It looks so promising… the only thing is i don’t get any results… installed it, chmod the folder to 777, saved the settings. working with wpmu 2.7.1, I activated the wpSearchMu only at main blog. I think its indexing only the main blog, which in my case is empty. any idea what could be the reason ?

  • 24 Sahar // Jun 10, 2009 at 10:40 am

    After some more checking… the index is always empty… (i can see the files at “/data//”
    but all files are empty… (the folder & even the files are 777)

  • 25 Paul // Jun 11, 2009 at 5:04 am

    Fabulous plugin…thanks very much.

    I also had an issue where no search results were displayed, but my blogs were all set to be private…making them public resolved it (well, removing the line that required public blogs to be returned did!)

    Was wondering if the author search was coming along :)

    -pc.

  • 26 Adam Wulf // Jun 11, 2009 at 12:29 pm

    Paul, good catch on the public/private blogs. hopefully that’ll help out Sahar and O. Let me know guys if this works for you?

    about author search… it’s on my list, but I’m swamped right now with work. I’ll get to it but don’t hold your breath :) although, I’m accepting .patch files if you want to build in author/category search… ;)

    Ray
    you have to modify the search.php files, otherwise the links will be pointing to the wrong place in the search results. To toggle between wpSearchMu and the default search, you can delete the search index in the plugin settings page. It’ll tell you at the top of the settings page which search is being used.

    as far as the option to search the one blog vs entire site, I don’t think that’s possible right now, but its a great idea for something to add.

  • 27 Sahar // Jun 11, 2009 at 5:50 pm

    Hןi Adam,
    well…. all my blog are public (nonarchived/spam/mature/deleted) :(
    Can’t find yet why the index remain empty…

  • 28 Sahar // Jun 11, 2009 at 6:10 pm

    Finally found what it was….
    i entered for ‘Blogs NOT to Index’ the main blog (which also was the only one public = 0 ….

    But…. now downside… search isn’t working with other chars than english (like, Chinese, Arabic, Hebrew….)… any idea why ?

  • 29 Steve // Jun 17, 2009 at 4:52 am

    I’m getting a weird issue with indexing. When I install and index whole site, the search results seems to ignore the blog name.

    So on blog /art I might have an article with url example.com/art/story.

    If I search in the top level blog the search results appear as: example.com/story. If I search on a different blog (/travel), the link to story in search results appears as: example.com/travel/story.

    Needless to say I only get the correct url to a story if I search for it in the blog it resides in (example.com/art/story).

    Why is it skipping the blog name in the search results URL?

  • 30 Steve // Jun 17, 2009 at 5:20 am

    I should also mention I’m using Wordpress Mu 2.7.1. Thanks for any help you can offer.

  • 31 Steve // Jun 17, 2009 at 6:53 am

    Maybe also mention that I use custom permalinks (%year%/%month%/%day%/%postname%/).

    Search is ok for pages but not posts. Pages use permalink (/pagename/) but search results show for example: /?page_id=22.

  • 32 Adam Wulf // Jun 17, 2009 at 11:33 am

    Steve, you need to update your search.php template file

  • 33 Steve // Jun 17, 2009 at 8:30 pm

    Thanks for your help. I did that but I was still getting the same results. But you pointed me in the right direction!

    I was using the Thematic theme and the search loop is buried in /library/extensions/content-extension.php. The loop was calling the function thematic_postheader(). I put the theme search integration in that function and it worked!

    Thanks for your help. Love this search tool. Well done.

  • 34 Adam Wulf // Jun 17, 2009 at 9:19 pm

    Steve, glad you got it working! :)

  • 35 IndiaPoint // Jun 20, 2009 at 11:53 pm

    I implemented it at

    http://indiapoint.net/site/

    However, it seems that it doesn’t search pages (?)

    How to make it search pages?

    thanks

  • 36 IndiaPoint // Jun 21, 2009 at 12:05 am

    Yes it searches pages as well - I didn’t test it fully earlier.

    Very nice indeed.

    The site is not fully completed - but the mu search works from:

    http://indiapoint.net/site/

    (I didn’t add the plugin in the muplugin folder, but in the plugin folder - it still works fine)

    Had been trying to implement it in a sensible manner - found that under normal conditions (even when implemented properly) it would break links in “recent posts” widget (bug perhaps?)

    So had to find some ingeneous manner of implementation !

    many thanks

  • 37 Sahar // Jun 22, 2009 at 8:22 am

    Does anyone knows why Chinese, Arabic, Hebrew indexing isn’t working ? (no results with wpSearchMu while one search shows the results)

  • 38 Adam Wulf // Jun 23, 2009 at 11:33 am

    @sahar, I’m not sure why non-ascii characters aren’t showing up correctly. I probably won’t have time anytime soon to fix it, but…. .patch files are welcome! :)

  • 39 IndiaPoint // Jun 26, 2009 at 12:17 am

    I have found that I have to rebuild the search index everytime. The index does not rebuild automatically.

    http://indiapoint.net/site/

    Whenever an articles is posted - it does not automatically show up on the site search. It is only when the search index is rebuilt that the new post/page come up on the site search.

  • 40 Adam Wulf // Jun 27, 2009 at 1:17 pm

    @indiapiont, you need to put wpsearchmu into the mu-plugins folder so that wpsearchmu is activated on all blogs. this ensures that any updates to those blogs will update all appropriate search indices. If it’s not activated for a blog, then updates to that blog won’t show up in any index.

  • 41 Dewey // Jun 29, 2009 at 1:50 pm

    Any chance of upgrading this? It isn’t working under 2.7.1.

  • 42 IndiaPoint // Jul 2, 2009 at 9:24 am

    Thanks, it works now *perfect* (WPMU2.7.1).

    I have put it in the plugin folder and also put the folder in muplugin folder. And I activated it sitewide from the installed plugin option.

    Dont know which one is working - but its working fine. Thanks a lot!

  • 43 Ray // Jul 6, 2009 at 6:28 pm

    Hi Adam,

    Let’s say I have more than a couple blogs, and I somehow want to mass-adminster those blogs for wpSearchMu.

    Is there a way to go about this, instead of manually going into each blog to configure wpSearchMu?

  • 44 Adam Wulf // Jul 6, 2009 at 10:54 pm

    @Ray, I’ll add that to the top of my todo list for this plugin. Great idea!

  • 45 Ramoonus // Jul 7, 2009 at 5:04 am

    Does it also work with Wordpress 2.8 (non-MU) ?

    Btw the version on this site is newer then in WordPress`s archive. That one features 1.0.0

  • 46 Ray // Jul 8, 2009 at 2:40 pm

    Hey Ramoonus,

    This is wpSearchMu, not wpSearch ;)

    Try wpSearch for WP Standard:
    http://wordpress.org/extend/plugins/wpsearch/

  • 47 Klark // Jul 14, 2009 at 8:26 pm

    The instructions here say to put it in mu-plugins, but the instructions on here say to put it in plugins?

    http://wordpress.org/extend/plugins/wpsearchmu/installation/

  • 48 Klark // Jul 14, 2009 at 8:31 pm

    Also, in your directions you say to chmod 777 this dir: wpsearchmu.

    I think this should be wp-search-mu?

  • 49 Adam Wulf // Jul 14, 2009 at 9:08 pm

    @Klark,

    correct install is to put it in mu-plugins. i’ll update the documentation on wordpress.org to reflect that. thanks for the heads up :)

  • 50 Klark // Jul 14, 2009 at 9:40 pm

    Thanks. I tried installing it, but kept getting errors when creating the index. I think it’s related to mbstring not being installed, so i need to look into getting that enabled.

  • 51 Sahar // Jul 15, 2009 at 4:31 am

    Regarding the mu-plugins folder:
    Plugins places in the mu-plugins directory will not show up in the Plugins menu.
    Therefor it must stay in the plugins folder for activation.

  • 52 IndiaPoint // Jul 15, 2009 at 6:35 am

    Is there any changelog (online) for the new update?

  • 53 Adam Wulf // Jul 15, 2009 at 12:16 pm

    @IndiaPoint, I’d forgotten to add the link last night, so I just added a link to the changelog just below the FAQ

    @Sahar, plugins in mu-plugins are automatically activated for all blogs in the system. the plugin has to be added to mu-plugins, or manually activated for every single blog, so that it can properly update it’s index when any post on the site is added/edited.

    You’re correct in that it won’t show up in the plugins menu, but it’s still activated on all sites. You should see the options page in the settings section of the admin sidebar.

    Cheers!

  • 54 Adhip Gupta // Jul 16, 2009 at 11:40 am

    Hey Adam,

    Great work there. And, a great plugin. Got it and installed it perfectly.

    I just have a little problem with this though. I am trying to search for ‘tags’ and am unable to do so. Is there any way to do it out of the box?

    Else, I would try to extend your work to make this happen. Any pointers for that would be helpful.

    Cheers,
    - Adhip.

  • 55 mercime // Jul 16, 2009 at 5:20 pm

    Adam, thank you for this plugin. As mentioned above, I got confused for a while when I saw the plugin readme still has uploading to plugins folder instead of mu-plugins per your webpage. I decided to follow your instructions on this site and I was able to index the WPMU site :-)

    For this specific WPMU install which is for a religious organization, when I input either Fr. Sebastian or “Fr. Sebastian” (with quotes) I get a list of all priests in the site like Fr. Charles, Fr. Ramon, Fr. Gary etc. etc. How can I make it I forgot the term, where search results should include all text input in searchbox?

    While just typing Sebastian gets the correct results (just great), I am sure that there will be those who will input Fr. Sebastian.

    Having said all that, thank you for this plugin :-)

    Thank you.

  • 56 Jon // Jul 17, 2009 at 11:57 am

    This made my day. Works perfectly (WPMU 2.8.1). I can’t believe sitewide search still isn’t part of core wpmu…

    One quick suggestion: you only need to create a ‘data’ directory inside wp-search-mu/ and then only chmod “data” to 777. Maybe you could even include an empty ‘data’ directory by default. I don’t generally like to chmod 777 things that don’t need it. :)

  • 57 Adam Wulf // Jul 17, 2009 at 11:04 pm

    @mercime, I honestly haven’t taken too close a look at the search syntax. After a bit of poking around, it looks like you’re query would have to be “Fr. AND Sebastian”, which I agree isn’t terribly intuitive. I’ll put this on the list to clean up, thanks for the heads up.

    @Jon, great tip! I’ll update the instructions for the next release to mention that.

  • 58 anointed // Jul 20, 2009 at 6:38 pm

    works perfectly as advertised!

    Add me to the list of those that would love to see the results categorized by site name and type.

    Meaning on my main blog I have this installed to search all other blogs.

    would love to see a results page, that would separate out the results via the site they were found on.

    example:
    search for ‘candy’

    results would be
    site: candylovers
    – posts
    —–results
    —–results
    –tags
    —–results
    —–results
    –comments
    —–results
    —–results
    site:chocoholics
    – posts
    —–results
    —–results
    –tags
    —–results
    —–results
    –comments
    —–results
    —–results

    etc…. would be a nice way to organize the returned results imho

  • 59 anointed // Jul 20, 2009 at 6:40 pm

    btw

    would also be really cool if it could search buddypress fields such as groups/wires/forums/users etc…

    With automatic behind buddypress now, I”m guessing it will become almost mainstream for wpmu as it matures.

  • 60 Adhip Gupta // Jul 22, 2009 at 10:10 pm

    Hey Adam,

    Quick Update: I was able to extend the search to search for the tags in the posts really easily and it worked like a charm.

    Great coding on the plugin to make it that easy to extend! :)

    Cheers,
    - Adhip.

  • 61 Tom Hopes // Aug 7, 2009 at 6:58 am

    This doesn’t work with the Thesis theme any ideas?

    Really like this but when you click update indexes the bottom left corner has an error for java and says not compatabile (or something similar) with Thesis.jss

  • 62 Adam Wulf // Aug 10, 2009 at 12:20 pm

    @Tom, I’m not sure about the Thesis theme personally. Hopefully another the Thesis-using commentor has some ideas? I’ve been debating Thesis for a while, I’d like to take the jump and help track down the problem, but I’m skeptical I’ll have enough time in the near future.

    If you end up finding a fix, by all means stop back by and let us know!

  • 63 Marjan // Aug 11, 2009 at 5:35 am

    I cannot get the indexing to work. I looked at all the comments from here but, nothing. Whatever I do, it only indexes the main blog (1) even when I tell it not to. The files in there are always 0 or 20 bytes. It is chmodded t0 777 (I deleted all the files and wp-search is able to make the files) .
    Other plugins I have installed in mu-plugins are:
    cet-blog-defaults
    defaults-categories
    tags4page

    Normal plugins:
    sidebar login
    cat_plugin

    The blogs are all public but have only the standard page and post in them (the welcome and about ones)

    I really need this plugin to work :)

  • 64 fikri // Aug 13, 2009 at 1:11 am

    hi,
    nice plugin. but does this search post meta as well? it would be great it if could.

    I noticed that you mentioned that it searches custom field, but when i did a search it does not return any result on post meta.

    Thanks.

  • 65 Adam Wulf // Aug 13, 2009 at 1:51 am

    @fikri, yikes! yeah, i haven’t implemented searching custom fields yet. that was on my wish list but didn’t make the cut for 1.0, and I guess I forgot to update my draft before publishing.

    I can’t believe I/anyone hasn’t noticed/spoke till now! I’ve updated the page to show the correct info.

    Thanks for the catch! I’ll look into implementing that asap.

    Cheers

  • 66 fikri // Aug 13, 2009 at 3:43 am

    @Adam Wulf , no problem. Let us know when you have implemented it. I’m sure it’ll help a lot of us out there.

    Thanks again for the great plugin.

  • 67 fplus // Aug 14, 2009 at 6:58 am

    Hi!
    I’m sorry but I’m French…
    Well I uploaded files, configured in my admin panel, but I don’t understand what to do in search.php file about the loop?
    If you could tell me very simply where to add what, it would be wonderful?
    If someone could tell me in French, it would be so so so so wonderful?
    Thank you

  • 68 fplus // Aug 14, 2009 at 10:43 am

    Well, I think I’ve installed it correctly…
    But if I’m serching a word which is in a post, it returns me : o no categories.
    I do not have any categories on my wpmu…
    What’s wrong?
    thank you for your help

  • 69 Adam W. Warner // Aug 14, 2009 at 3:41 pm

    I’m itching to get started, and will most likely experiment, but the directions on this page say to install in mu-plugins and the directions in the readme.txt say to install in the regular plugins folder.

    Can you confirm which plugin folder this should be installed in?

  • 70 Adam Wulf // Aug 14, 2009 at 7:51 pm

    it should be installed in mu-plugins. I’ll update the readme in the next version

  • 71 Adam W. Warner // Aug 15, 2009 at 11:23 am

    Hi Adam, cool name :)

    Thanks for confirming this. It would appear that I have everything working correctly, but I haven’t been able to get any search results. One thing that may be affecting this is my use of the Thematic framework. It requires that I have a function to filter the search loop in order to add your code, and frankly, I’m not sure it’s correct. I’ve posted to the Thematic forums regarding this here:
    http://themeshaper.com/forums/topic/can-someone-check-this-function-please

    I also have the three blogs I want to search marked as “block search engines” in the Privacy settings, but I changed that to “allow search engines” when building the database and testing.

    Can you advise on a next step for troubleshooting? Your plugin sounds awesome and I’d love to get it working so I can write up a detailed post on how I’m using it.

    Thanks for your time,

    Adam

  • 72 Adam W. Warner // Aug 15, 2009 at 3:00 pm

    Did I say something wrong in my last comment? It’s missing.

  • 73 Adam Wulf // Aug 15, 2009 at 3:28 pm

    @Adam, not at all :) it landed in the moderation queue for some reason. I’ve just now approved it.

    Re: thematic, not sure what the problem could be. I haven’t used thematic framework before. Hopefully the forums have some good ideas.

  • 74 fplus // Aug 17, 2009 at 2:58 am

    hello!
    no idea for my problem?
    Thank you

  • 75 Adam Wulf // Aug 17, 2009 at 3:39 am

    @fplus, i’d say to double check that it’s installed in the mu-plugins directory, and that the wpsearchmu directory is chmod to 777. Once that’s done, be sure to re-index everything from the plugin’s options page.

    for the search.php, add those two lines of code mentioned above to the beginning and end of the search results while loop.

    Hope that helps!

  • 76 fplus // Aug 17, 2009 at 5:17 am

    hoo?my post doesn’t appear anymore?

  • 77 Adam W. Warner // Aug 17, 2009 at 9:35 am

    Yeah, something’s weird with your comments Adam. It looks like fplus experienced what I did the other day.

    I posted, and it showed my comment, then I came back and refreshed the page and it was gone, then another refresh later and it was back.

  • 78 fplus // Aug 17, 2009 at 9:55 am

    Well, I added some php code inside my post…
    Could it be the reason?
    What the way to do it?

  • 79 Adam W. Warner // Aug 18, 2009 at 10:37 am

    Hi Adam,

    With the assistance of Chris on the Thematic forum, I have been able to filter the Thematic search loop in order to add the bits of code required for your plugin. See here: http://themeshaper.com/forums/topic/can-someone-check-this-function-please

    Here was the process I went through. I have four blogs on this MU setup. Each blog has it’s own Thematic child theme.

    The first thing I did was move the wp-search-mu directory and the wp-search-mu.php file to the mu-plugins folder. I then set the wp-search-mu directory permissions to 777.

    Next, I added the search filter to the functions.php file of the main blog child theme. Just this child theme, none of the others.

    I went into all four blog’s Privacy settings and made sure they weren’t blocking search engines. I then went into each blog’s dashboard and the wpSearchMu settings and ran the indexing process.

    voila’! Searching from each blog returns results from all blogs. :)

    Now, there is one thing I did run into and that was that I was trying to filter the indexing to NOT include one blog with an ID of 2. When I entered that ID into the “Blogs NOT to Index” field, the page just refreshed with no apparent indexing process. It was later that I realized this was probably not indexing because the blog with ID 2 was set to block search engines in the Privacy settings.

    I hope this helps others, and Adam, thanks again for a great plugin!

  • 80 Adam Wulf // Aug 18, 2009 at 2:38 pm

    @Adam - glad you got it figured out! and thanks for providing the fix process for Thematic, I’m sure this’ll help out others as well!

  • 81 fplus // Aug 19, 2009 at 2:57 am

    Hello!
    Where could I give you my code to verify it’s correct,?
    ‘Cause I did it like you told, but no way to get any answer?
    Thank you

  • 82 Adam Wulf // Aug 19, 2009 at 3:48 am

    @fplus, shoot me an email w/ the .php attached and i’ll take a look. my contact info is on the front page

    Cheers

  • 83 fplus // Aug 19, 2009 at 4:25 am

    done!
    Thank you

  • 84 Danilo Assis // Aug 29, 2009 at 1:12 am

    hey, REALLY GREAT plugin! :D
    it worked all fine here. only one question, is there a way of filtering search by blogs in search.php? i want to filter by blog through a drop list menu. i tried switch_to_blog before the loop but nothing…

  • 85 fplus // Sep 1, 2009 at 12:35 am

    Hello Adam Wulf

    Did you have time to have a look on my mail?
    Thank you

  • 86 Adam Wulf // Sep 1, 2009 at 1:48 am

    @fplus, sorry! thanks for keeping me honest :) check your inbox, i just now replied

  • 87 Adam Wulf // Sep 1, 2009 at 2:19 am

    @Danilo, wpsearchmu doesn’t have the ability to search specific blogs from a dropdown. I’ll log this as a feature request for future versions :)

  • 88 Adam Wulf // Sep 1, 2009 at 2:24 am

    @Marjan, if the search results are always sending to the blog that you’re searching from, I’d double check that you’ve updated your search.php properly. If you don’t put the switch_to_blog() and restore_current_blog() in the right place, then the links in the search results can get messed up.

  • 89 Tom // Sep 1, 2009 at 6:52 am

    I have installed it and created the index. When I search, nothing is found. The instructions here, http://wordpress.org/extend/plugins/wpsearchmu/installation/, do not mention having to change the search.php loop - is this still required?

  • 90 Danilo Assis // Sep 1, 2009 at 11:20 am

    @adam, I implemented this on the fly filter… it was not the best practice since I make the filter under the hits (of all blogs) that were returned. :)

    but it’s working just fine!

  • 91 Adam Wulf // Sep 1, 2009 at 1:15 pm

    @Tom, yup, the wp.org is out of date, i’ll update that. editing the search.php is still required, although that’ll just fix the links for results that do show up. if no results are found, double check that you’ve indexed correctly, and that the blogs are marked as public.

  • 92 Danilo Assis // Sep 1, 2009 at 7:21 pm

    hey, it’s triggering this error when i try to add or delete a post, page etc…

    Fatal error: Uncaught exception ‘Zend_Search_Lucene_Exception’ with message ‘File ‘/home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/data/8//_o_1l.del’ is not readable.’ in /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Storage/File/Filesystem.php:59 Stack trace: #0 /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Storage/Directory/Filesystem.php(358): Zend_Search_Lucene_Storage_File_Filesystem->__construct(’/home/matriz_on…’) #1 /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Index/SegmentInfo.php(309): Zend_Search_Lucene_Storage_Directory_Filesystem->getFileObject(’_o_1l.del’) #2 /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene.php(390): Zend_Search_Lucene_Index_SegmentInfo->__construct(Object(Zend_Search_Lucene_Storage_Directory_Filesystem), ‘_o’, 219, 57, 1, true) #3 /home/matriz_online/ in /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Storage/File/Filesystem.php on line 59

    do you know what could it be?

  • 93 Adam Wulf // Sep 1, 2009 at 8:06 pm

    @Danilo, double check that you’ve chmod’d /recursively/ the entire data directory to 777

  • 94 Danilo Assis // Sep 2, 2009 at 12:08 am

    yeeeeeeah! i went through ssh and chmod’d -R the directory! the files generated by the plugin come with a 755 permission set… i made a cron job to chmod 777, but i think it’s not the best practice.

    any ideas why this is happening?

  • 95 Danilo Assis // Sep 2, 2009 at 12:16 am

    and now this error when i index a blog:

    Fatal error: Ignoring exception from Zend_Search_Lucene_Proxy::__destruct() while an exception is already active (Uncaught Zend_Search_Lucene_Exception in /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Storage/File/Filesystem.php on line 59) in /home/matriz_online/beta.matrizonline.com.br/wp-content/mu-plugins/wp-search-mu/wpSearch.php on line 942

  • 96 Steve // Sep 3, 2009 at 5:05 am

    I just installed it on a subdirectory install of WPMU and although the search works it seems to permalink everything as a post of the base blog rather than the subdirectory blog that it belongs to

  • 97 Steve // Sep 3, 2009 at 5:20 am

    I found the problem, its to do with themes that do not have a specific search page defined

  • 98 Steve // Sep 3, 2009 at 8:03 am

    If you’ve got the Recent Posts widget on the sidebar and you do a search then the Recent Posts list goes very odd, and turns into a list of posts that the search has pulled back (but without the proper permalinks).

    Here’s an example: http://blogs.canalplan.org.uk/mintball/search/wigan which shows the incorrect Recent Posts.

  • 99 Tom // Sep 3, 2009 at 2:00 pm

    Got this working, it was down to the blogs not being set to public. I didn’t have to touch the search.php

    If I wanted to not search the content of a post/page, where would I do this. Looking in the code, I see
    $doc->addField($post_content);

    which looks like it could be it. The MU site I am working on is huge and they don’t want the content search because it is bringing back so many results

  • 100 Adam Wulf // Sep 3, 2009 at 3:17 pm

    @Tom, instead of changing that line, look near lines 226 ish and change:
    $content_query = “post_content:($q)”;
    to simply:
    $content_query = “”;

    This will preserve all of the post content in the search index itself (so you can add advanced search later if needed), but still restrict the default search to title/tags only.

  • 101 Steve // Sep 4, 2009 at 6:14 am

    Thought I’d let people know that wpsearchmu is not fully compatible with the NiceSearch plugin (http://txfx.net/code/wordpress/nice-search/) unless you change the searchform.php file in your themes to use action=”/”

  • 102 Anup Mukherjee // Sep 7, 2009 at 1:47 am

    Please tell me, whether wpsearchmu works on subdomain install of WPMU?

    thanks

  • 103 Adam Wulf // Sep 7, 2009 at 2:28 am

    Yes, wpsearchmu should work fine for subdomain install of wpmu

  • 104 Jack // Sep 8, 2009 at 1:15 pm

    This is a request for help with a little hack. (I just installed wpsearchmu on the new site I’m building and everything worked perfectly. Thanks, Adam, for making this so simple and easy!)

    For the results page, I’m wondering how I might make results display in teaser form, like excerpts of posts rather than the entire post? Seems like it should be an easy enough hack. Can someone can point me in the right direction? I’m just learning PHP..

  • 105 Steve // Sep 8, 2009 at 3:00 pm

    Jack, create a search.php file (if there isn’t one there) - copying from index.php and replace the_content() with the_excerpt()

  • 106 mwaterous // Sep 14, 2009 at 3:37 am

    I’d love to test this plugin out, as I’m planning on launching a new µ site soon using multiple blogs/subdomains as the main web site. I’d like the ability to search across all of them at the same time so that the integration is as seamless as possible…

    anywho… when I unpacked your archive to my mu-plugins folder, not a thing shows up in the dashboard. Anywhere. I’ve reloaded, logged out and back in, checked everywhere. Nothing…. anybody else come across this?

  • 107 Adam W. Warner // Sep 14, 2009 at 8:01 am

    @mwaterous,

    Make sure you got this part right…

    move the wp-search-mu directory and the wp-search-mu.php file to the mu-plugins folder

  • 108 Tom // Sep 14, 2009 at 10:06 am

    Thanks for the help above re: not searching the content.

    Another request now :)

    to enable to the wpmu search to work on subblogs, I have to go to each blog and build the index.

    I am using this plugin: http://ocaoimh.ie/wordpress-mu-sitewide-tags/, which collects all the posts and stuff from around the site. When I do a search, it actually duplicates the results, but only on subblogs (not my main master blog).

    If I put the ID in, so it is not searchable, nothing comes back.

    Could I hardcode this into the plugin code so I don’t have to do it for each subblog?
    Thanks

  • 109 mwaterous // Sep 14, 2009 at 4:29 pm

    @Adam,
    First thing I did. I even checked to make sure the add_options_page was hooked into admin_menu properly, which it was… so I tried changing it to add_management_page with no luck, which is when I noticed another oddity.

    I tried exiting the script from wp-search-mu.php, and nothing happening. It seems µ doesn’t see it. When I added the include to another mu-plugin it loaded the search just fine. It appears I might’ve discovered an odd bug that’s refusing to let µ see the plugin. If I can figure out where it’s occurring I’ll probably file a trac.

  • 110 Jack // Sep 15, 2009 at 3:26 pm

    Hi Adam - I’m getting the same problem as Danilo above– and even after trying a chmod 777 to the entire “wp-search-mu” and “Storage” directories, posting/editing any page/post leads to a blank page and this error in the logs:

    PHP Fatal error: Uncaught exception ‘Zend_Search_Lucene_Exception’ with message ‘File ‘/[root]/wp-content/mu-plugins/wp-search-mu/data/1//_47_4.del’ is not readable.’

    in /[root]/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Storage/File/Filesystem.php on line 59, referer: http://usas.org/wp-admin/page.php?action=edit&post=38

    Any ideas? Please help — I’d really like to keep using your plugin but I can’t have it breaking posting & editing. Thanks for all your work on this.

  • 111 Jack // Sep 17, 2009 at 1:33 pm

    Adam - An update on the above problem: Even if chmod 777 the whole “wp-search-mu” directory, many files in the “data” folder are created with their owner as “nobody” so that I can’t chmod or chown them! I even tried creating the “data” directory myself and chmod 777′ing it before building the index, but I still don’t have permissions to those files. This probably only affects those of us on virtual hosting, but it’s a big issue since it’s preventing posting/editing of posts & pages. I assume the problem is Zend, not your script, but thought you could help?

  • 112 mwaterous // Sep 17, 2009 at 3:30 pm

    My problem has been fixed.

    *smacks Adam’s hands*

    No short tags, no. ;)

  • 113 Adam W. Warner // Sep 17, 2009 at 3:42 pm

    Just received an error and wonder if someone here more knowledgeable than me can advise if there is a fix I can implement?

    I am bulk editing posts in order to add them to additional categories all at once. I received this timeout error when editing 69 posts at once…

    Fatal error: Maximum execution time of 30 seconds exceeded in /home/myusernam/public_html/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Index/SegmentInfo.php on line 1518

    Line 1518 of that file is:
    return $this->_lastTerm;

    …from this chunk of code….
    /**
    * Returns term in current position
    *
    * @return Zend_Search_Lucene_Index_Term|null
    */
    public function currentTerm()
    {
    return $this->_lastTerm;
    }

    Is there a way I can increase the maximum execution time in this plugin? I would only need to do it temporarily, and it would be great because I still have a need to bulk edit hundreds more posts.

  • 114 Jack // Sep 17, 2009 at 3:48 pm

    I’ve fixed my problems with permissions errors breaking my posting/editing, and with searches returning no results! I had to fix what seems like a bug at line 390 of wpSearch.php, and in the process I updated the Zend directory to the latest Zend release (plus I had to repeat Kenny’s process of correcting a few things in the Lucene files).

    You can download my modified version of wpSearchMu here: http://propertyistheft.usas.org/2009/09/17/wpsearchmu-with-updated-zend/ if you’re having the same problems I was. This works perfectly for me, but I make no promises it’ll work for you, since I’m pretty new to this.

    Adam - Feel free to integrate the Zend directory I updated and that little fix to wpSearch.php if you want!

  • 115 Alecs Dinu // Sep 22, 2009 at 9:34 am

    Hi Adam,

    You did a great job with this plugin.

    But I’m facing a problem with the indexes built manually from admin though. Doing this it generates an index only for blog 1 which is the admin primary blog.
    The index is created in wpSearch.php:375 for the active blog, which is the admin blog. After that all the results from the other blogs are added to this index.

    Another thing I noticed is when checking for an existing index . The function wpSearchIsIndexBuilt().

    The function wpSearch_Query() only returns results from Lucene if an index is build for a blog. Because there is only one index (blog 1) it will return false and skip the lucene search.

    Maybe I missed something when I installed the plugin.

    Thanks

  • 116 Jack // Sep 22, 2009 at 10:50 am

    @Alecs - What’s the actual problem you’re having when you try to search? No results from sub-blogs? In my setup it only created a directory for blog 1, too, but it hasn’t caused any problems — searching works fine and returns results from all blogs, with accurate links.

  • 117 Alecs Dinu // Sep 22, 2009 at 1:36 pm

    Hi Jack,

    The results I get from searching withing a blog are not generated by wpSearchMu.

    If you look at the code in wpSearch.php , the function used to return the search results is wpSearch_Query($posts).
    At line 201 inside that function the plugin checks to see if an index exists. For this it uses the wpSearchIsIndexBuilt() function. It will use Lucene search only if this function returns true.

    For me this function alway returns false because
    it checks to see if the index file exists. But if I want to search only withing a blog, that function will look for an index for that blog.
    Check the lines 154 and 155.

  • 118 Tom // Oct 5, 2009 at 11:15 am

    Hi.

    I also had the same problem as #92. It was working fine for weeks and when an author tried to publish a post, they received a blank whitescreen.

    I turned php errors on and it pointed at this plugin. I had to fully delete it and all the files from the ftp (although there was one blog folder that would not delete), and then reinstall and it all is working fine again. I have no idea what caused this but it happened about 2 months ago as well.

  • 119 Jon // Oct 9, 2009 at 9:13 pm

    I have tried to install this plugin with no success. The information here and on wordpress.org seem to be contradictory. Does wpsearchmu or wp-search-mu go in mu-plugins? I’ve tried placing wpsearchmu in mu-plugins and chmodding it, placing wp-search-mu in mu-plugins and chmodding, placing wp-search-mu and wp-search-mu.php in mu-plugins. I also tried placing wp-search-mu in plugins and chmodding. The only thing that came close to working was when I had it in plugins. In that case it stalled while trying to create the index. The data folder and its contents were created but it never refreshed the page and when I visted the settings again it acted like the index had not been created. When I put it in mu-plugins I do not even got a link to the options page to create the index. Any suggestions?

  • 120 Adam W. Warner // Oct 9, 2009 at 9:34 pm

    Hi Jon,

    See my comment above for where to place the directory AND the file, http://welcome.totheinter.net/wpsearchmu/#comment-5691

    Also, make sure that the blog you’re indexing Privacy settings is not set to “Block all Search Engines”.

  • 121 Jon // Oct 10, 2009 at 2:23 am

    Adam,

    Thanks but that was one of the things I tried. I put wp-search-mu and wp-search-mu.php into mu-plugins and changed the permissions on wp-search-mu. When I visit the Dashboard I do not see any way to interact with wpSearchmu settings. It is not listed under the Settings panel. I am stumped.

  • 122 Adam W. Warner // Oct 10, 2009 at 8:19 am

    Hey Jon,

    Sorry to hear that, pretty strange that it’s not showing in the settings panel. What version of wpmu are you using?

    Maybe the REAL Adam could jump in here and offer some suggestions.

  • 123 Jon // Oct 10, 2009 at 1:02 pm

    It’s 2.7.1. We’ll be upgrading to 2.8.4 soon.

  • 124 Tibor // Oct 15, 2009 at 6:33 am

    I am having the same problem as Jon; if I put the plugin files in the mu-plugins directory it won’t show up in the admin section.

    It does when putting all in the standard plug-in directory, but then it won’t index (nothing happens and the page never gets reloaded).

    This is with WPMU 2.8.4

  • 125 Jason // Oct 28, 2009 at 1:02 am

    I haven’t tried this yet but I’m wondering if I can specify a “search by” functionality with this plugin. E.G. A user can select criteria or a filter to search on, say “keyword” would search only tags and “location” would search a custom field I’ve added to posts.

    Is this kind of functionality possible with this plugin?

  • 126 Kamil // Oct 28, 2009 at 10:47 am

    Is building indexes dangerous? In my wpmu installation is about 1,400 blogs and they’re working for about few months, so there are many posts. In Settings panel is information that: “This should be done immediately after installation and almost never after. “. I’d like to use this plugin, but I must be sure that it doesn’t make any damage to existed data.

    Any suggestion or explanation is welcome :)

  • 127 Jason // Oct 28, 2009 at 3:21 pm

    @Kamil:

    I have yet to use this plugin due to my question about (i’m going to try a test today…but I’d still like to know). But to put my two cents in, I can’t imagine this would affect anything within your site but if there is an error I would believe (and hope) it would be constrained to the plugin and it’s files/tables if any. If this does spread out into the normal site files then I’m a little apprehensive myself to install this.

    You should probably just dump your database to your local machine or a staging site and give it a run and see what happens though…that’s what I’d do :-)

  • 128 Jason // Oct 28, 2009 at 3:27 pm

    I just put this into my clean installation of wordpress mu 2.8.4a into the plugins folder (not the wpmu plugins folder) and made sure that the wpsearchmu folder was chmod 777. It doesn’t show in my plugins section on the dashboard.

    So I moved it to the mu plugins directory, again making sure I chmod 777, still nothing. What am I doing wrong? I’m following the README . :-(

  • 129 Adam Wulf // Oct 28, 2009 at 4:32 pm

    @Kamil, wpSearchMu doesn’t modify the data in any way. it creates it’s own index on the file system. It only ever reads from the database, never writes, so it won’t harm your data.

    Since you have such a large site, I’d recommend starting the index at night and letting it run overnight. that way it’s indexing during a lower site traffic.

    @Jason, @Jon, i can’t think of anything offhand that would cause the index not to be built for you guys. is anything in the apache/php logs? unfortunately i won’t have any time to work on it in the next 2-3 months, so hopefully someone else can step up in the meantime and help track this down?

  • 130 Jason // Oct 28, 2009 at 5:58 pm

    Well it’s not about the index being built for me, it’s about the plugin not showing. I’ve moved the plugin files (wp-mu-search folder and the wp-mu-search.php file) to the normal wordpress plugin directory not the mu plugins and it now shows. I’ve also had to change the short tag from <? to <?php in BOTH the wp-mu-search.php files (why are there two??) in the wp-mu-search folder as well as the top level one.

    I haven’t tried building the index yet…just got it to show, but something makes me think it won’t work this way anyhow since it’s probably supposed to go in the mu-plugins folder. Any suggestions?

  • 131 Jason // Oct 28, 2009 at 7:15 pm

    I finally got this plugin showing in my plugin section of the dashboard while in the wordpress-mu plugins folder. I had to change the shorttags to <?php in the two files I mentioned above, chmod -R like normal, but I had to first place these files in the normal plugin folder, activate, build the index.

    Then I moved the files without deactivating them to the mu-plugins folder and they are working. The only issue I’m having now is that when I create a new sub blog, I have to re-index the wpmusearch, is this normal? It’s not a big deal really since on my site the admin must make a new blog for the user and thus will just manually hit the index button again…or i can create a script to do this when a new blog is made. I just want to know if this is the correct behavior?

    Also, is it possible to search custom fields as stated in the wishlist above? If so, how do I set that up?

  • 132 Kamil // Oct 30, 2009 at 6:07 am

    @Adam Wulf: creating indexes is running still… about 20 hours ;) there should be some progress bar ;)

  • 133 Jason // Nov 6, 2009 at 11:50 am

    It’s me again.

    I’ve managed to modify this to use my custom fields…however it is still searching on post text also. I’ve put in a switch statement that takes in a hidden “filter” field in my search form. I know this is working because it’s getting in the correct case. In that case I’m literally using the following lines:
    $wpSearch_log->LogInfo(”$country_query”);
    $query = Zend_Search_Lucene_Search_QueryParser::parse(”$country_query”, $wpSearch_defaultEncoding);

    Where $country_query is the text blob returned to me (extremely similar to the already existing “wpSearch_getPostComments” function; but instead goes to the postmeta table for each blog and grabs all meta_keys of ‘country’.

    This works great at filtering out the other custom fields I’m using but still does a full text search…which I thought was handled by the other arguments here:
    $query = Zend_Search_Lucene_Search_QueryParser::parse(”$title_query $content_query $tags_query $comment_query”, $wpSearch_defaultEncoding);

    What am I doing wrong? I can email you my wpSearch.php file if that’s easier…

  • 134 Ira // Nov 18, 2009 at 7:37 pm

    Thanks for the work on the great plugin. I was wondering if you had plans to upgrade it to work with 2.8.6?

  • 135 Sudeep Bhaumick // Nov 19, 2009 at 4:11 am

    @Adam Wulf, Thank you for a great plugin.

    @Jason, Thank you for sharing your experience, it really helped.

    I am running this plugin on WPMU 2.8.6 it works like a charm. Just follow Jason’s tip on changing the shorttags to Privacy > Enable “I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers”

    This has to be done individually for all blogs.

    Hope this helps someone :)

  • 136 Sudeep Bhaumick // Nov 19, 2009 at 8:29 pm

    Corrections…

    I am running this plugin on WPMU 2.8.6 it works like a charm.

    Just follow Jason’s tip on changing the shorttags to Privacy > Enable “I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers”

    This has to be done individually for all blogs.

    Hope this helps someone :)

  • 137 Ira // Nov 24, 2009 at 3:48 pm

    @Jason: Can you post the modifications you made that allowed it to search custom fields?

  • 138 Ira // Dec 7, 2009 at 3:18 pm

    Has anyone had a problem with the search combining its indexes? The .cfs files in each of the /data/blognumber/ folders contain all the content for every blog indexed and the search results pull all of the results regardless of the switch_to_blog number.

    I get 8 files in each /data/blognumber/ folder, mostly lock files if that helps.

    Fresh installs produce the same results. Any help would be awesome. Thanks!

  • 139 Greg // Dec 17, 2009 at 12:13 pm

    For what ever reason I only receive one result per search? any thoughts?
    plugin in the mu-plugins dir
    chmod to 777 recursively
    added in search filter
    made sure each blog was visible to the world
    Built search index for blog from the admin without changing settings

    Using a Modified Simple Balance theme for each blog.

  • 140 Greg // Dec 17, 2009 at 12:18 pm

    nevermind… CSS issue eveything is there it was just stacked on search result ontop of another because of a css float property. Sorry about that.

  • 141 josh // Dec 22, 2009 at 4:13 pm

    Nice plugin. I installed it on my dev box and all is well. I move the plugin up to my prod and no dice. The Search does not show up in the Settings tab. WP MU are the same versions on dev and prod. Any quick thoughts on troubleshooting where it is not initializing?

  • 142 josh // Dec 22, 2009 at 4:26 pm

    Little more info on my part..wp-settings.php is barking when it is trying to load wp-search-mu.php. complaining about Failed opening ‘/srv/www/htdocs/MYWEBSITE/wp-content/mu-plugins/wp-search-mu.php’ for inclusion (include_path=’.:/usr/share/php5:/usr/share/php5/PEAR’)

    PEAR for PHP 5 is installed. Any other thoughts?

  • 143 neil // Jan 5, 2010 at 3:01 pm

    @Adam Wulf:

    This plugin ROCKS. Especially because the Blogs Directory plugin from WPMUDEV breaks SimplePress installs.

    Here’s my question for you: At 5200+ blogs, what I need YOURS to do is just create an index of the blog names. It might not surprise you to find that the index build process throws me an “allowed memory size exhausted” error after about half an hour.

    I’m assuming I’m getting the error because I’m trying to index all the POSTS for the blogs as well - the ONLY thing I need it to index is the blog titles. And no, I have no intention of ever using ANY other search beyond that. My WPMU install is for a pretty specific purpose, and beyond searching blog names, search capability isn’t a big deal.

    Can you (or any of the other geniuses in here) help me figure out how to hack the plugin so the only thing that gets indexed is the name of the blog?

    Thanks!

  • 144 Vladislav // Jan 12, 2010 at 11:47 am

    How can i start the index building process … i have 10000+ blogs …
    Whens i click the build index button i get:
    Rebuilding index …
    Fatal error: Ignoring exception from Zend_Search_Lucene_Proxy::__destruct() while an exception is already active (Uncaught Zend_Search_Lucene_Exception in /home/www/wp-content/mu-plugins/wp-search-mu/Zend/Search/Lucene/Storage/File/Filesystem.php on line 59) in /home/www/wp-content/mu-plugins/wp-search-mu/wpSearch.php on line 912

    Any suggestions ??

  • 145 jesse // Jan 14, 2010 at 12:03 am

    Very nice plugin but I need to exclude categories somehow. Would be nice if you could do that in the plugin control panel.

  • 146 jesse // Jan 14, 2010 at 5:19 pm

    I just upgraded to wpmu 2.9.1 after successfully getting this plugin to work by turning on blog visibility to search engines (in 2.8.6). However, after the upgrade the search wouldn’t find any results outside of the current blog. I deleted the wp-search-mu folder and wp-search-mu.php file - reuploaded a fresh copy of both - chmod 777 to wp-search-mu, turned on blog visibility on all target blogs, indexed each and it works fine again.

  • 147 Adam W. Warner // Jan 14, 2010 at 5:26 pm

    Thanks for letting us all know Jesse. I’m going to need to upgrade my MU installation and I’ll be sure and follow your steps:)

    p.s. I’m a different Adam than the author, just another thankful user:)

  • 148 Douglas // Jan 15, 2010 at 8:00 pm

    The Zip file was jumbled after unzipping and had to be rearranged. The readme.txt and wp-search-mu.php files were outside the wp-search-mu folder, and all the files were within another folder called wpsearchmu. WP MU didn’t recognize the plugin until everything was put back into the same folder and moved up one level.

  • 149 Christian // Jan 29, 2010 at 2:19 am

    Hi.,

    I change the chmod to 777 undcr mu-plugins and configure search.php but nothing happens. It cannot search any post from other sub-blogs. Then I relocate the plugin to wp-content/plugin and change the chmod to 777, but when i am about to activate it at backend, it triggers a fatal error “Parse error: syntax error, unexpected T_STRINGParse error: syntax error, unexpected T_STRING in /home/my_blog/wp-content/plugins/wp-search-mu/wpSearch.php on line 315″.

    Anyone who already encountered this problem??

    Thanks…

  • 150 Diego Ferrari Bruno // Feb 21, 2010 at 12:20 pm

    Hi Adam! REALLY LOVED the plugin! Nice work, very nice codding!
    2 thing to say:
    1- BUG - when i exclude one of the blog, right after instalation, the cache is not built.
    2- i would like to sort the results by date, is it possible? i really tried to hack it but i gave up….

    Many Thanks!

  • 151 Gab // Feb 26, 2010 at 6:52 am

    I don’t get it. Is it the “wp-content/mu-plugins/” directory or “wp-content/plugins/” ?

    In this article right here, you say it’s the “mu-plugins” directory. But in comment #5 you say it’s “plugins”, and in the readme file you also mention the “Wordpress plugins directory”.

    So which one is it?

  • 152 Edward // Mar 3, 2010 at 8:55 pm

    <333333333333

    Awesome-ness.

    Gab, it works fine under the plugins directory.

  • 153 Kevin // Mar 8, 2010 at 4:43 am

    I wonder if anyone has any level of success getting this to work with custom fields? Thanks.

  • 154 Ira // Mar 10, 2010 at 6:38 pm

    @kevin
    If you’re not afraid to get your hands dirty changing the plugin, I can dig up the steps I had to take to add custom field indexing and searching.

    It takes a bit, but it’s doable. Do you want me to get that for you or have you found a different solution?

Leave a Comment or [Post to Twitter] Tweet This