Search Unleashed

download

Download: Search Unleashed
Version: 1.0.6
Supports: WordPress 2.9.2 – 3.0
Other: WordPress.org | SVN
Support: This plugin is no longer actively maintained

Search Unleashed extends the standard WordPress search with customisable search engines, including MySQL’s full text and Zend’s Lucene, as well as word highlighting and the ability to search across posts, pages, comments, titles, URLs, and meta-data.

The plugin also ensures that a search is performed against what a web browser sees, not what is contained within the database. For example, a lot of plugins will insert data into posts using shortcodes. Because this data is inserted run-time it is not included in any search results – the data is invisible. Search Unleashed performs searches across all data, including that added by plugins.

Some features of this plugin are:

  • Customisable search engines (default WordPress, indexed WordPress, MySQL fulltext, Zend Lucene)
  • Optional wildcards and logical search operations
  • Optional prioritisation of fields – you decide what is more important
  • Search posts, pages, comments, titles, URLs, tags, and meta-data (all configurable)
  • Search data after it has been processed by plugins, not before
  • Search highlighting of all searches, including titles and comments
  • Search highlighting of incoming searches from external search engines (such as Google)
  • Search results show contextual search information, not just a post excerpt
  • Record search phrases and display in a log
  • Exclude specific posts and pages from results
  • No changes required to your theme
  • No changes made to standard WordPress database tables
  • Advanced search widget (WP 2.8+)

Search Results

Search Unleashed is available in the following languages (included in the plugin):

Installation

Full installation details can be found in How to Install a WordPress Plugin.

How it works

Search Unleashed works by maintaining a search index that includes all processed information from your site. This is unlike the default WordPress search and most other search plugins, which directly use post data. Although maintaining a separate index is initially more work, the benefits are that a search is faster (it is only looking through relevant information) and can be made on data after processing by plugins. This last point is a key feature of Search Unleashed, and an example is given below.

A lot of plugins provide the ability to insert or modify data dynamically. This is typically achieved by inserting special shortcodes into posts. For example, Sniplets is a plugin to insert data into a post:

[sniplet some processed data]

This is fine when displaying the page, but when it comes to searching, the default search only sees the shortcode and not the end result. This means that any dynamically added data is invisible to the search, making the search itself somewhat less useful.

Search Unleashed indexes data after it has been processed by plugins, making all dynamically modified data visible to searches. The index is maintained separately to core WordPress data, so there is no worry of any corruption or incompatibilities caused by future upgrades.

Configuring the plugin

So you’ve installed the plugin, tried a search, and nothing happened. What’s wrong? First you need to configure the plugin. Don’t worry, this stage is painless and only needs be done once.

Configuration of the plugin takes place from the Search Unleashed administration page:

Admin Menu

There are several sub-pages, each accessible from the menu at the top of the page:

Submenu

Modules

Modules determine what data Search Unleashed indexes. For example, you can configure Search Unleashed to index post content, title, and URL.

Modules are enabled or disabled by checking the box on the left:

module enable

Modules can be configured by clicking the edit icon on the right:

edit module

Note that although a priority is provided in each module, only the Lucene and MySQL fulltext search engines use this. Details on prioritisation can be found in the Search Engine section.

The following modules are provided:

  • Post content
  • Post excerpt
  • Post category
  • Post author
  • Post meta-data
  • Post slug (URL)
  • Post title
  • Tags
  • Comment author URL
  • Comment content
  • Comment author

Note that ‘post’ includes pages.

Options

The options page is split into several sections.

General Options

Search options

  • Log expiry – Configure how many days worth of log data to retain. Enter 0 for no expiry, or -1 for no logs
  • Replace category archive – Replace the category archive with a search based on the category name. That is, replace the ‘WordPress’ category archive with search results for ‘WordPress’
  • Replace tag archive – As above, but replaces a tag archive page with search results
Spider Options

Spider options

  • Search Engine – Select which search engine to use (see Search Engines below)
  • Pages to exclude – Post/page IDs that will not be included in search results
  • Categories to exclude – Category IDs where posts in that category will not be include in search results
  • Include – Specify whether to include pages, posts, password-protected posts, private posts, or draft posts
Theme Options

Theme options

  • Force content display – Some themes, such as the ‘default’ theme, do not show any post content when displaying search results. This option tries to force the display of post content so that it can be highlighted.
  • Search results page title – Change the title of the search results page to reflect the search conditions (i.e. includes the search phrase and number of result pages in the page title)
  • Highlight searches – Highlight search results
  • Highlight incoming searches – Incoming searches are from external search pages such as Google. Note that this may interfere with WP Cache and WP Super Cache
  • Theme title position – Modify this if your title is not highlighted correctly
Search Style

Search Style

  • Include highlight CSS – Include the CSS for highlighting search results. Disabling this will require you to use your own CSS
  • Highlight colour – Select CSS colour values for highlighted phrases

Filters

Search Unleashed allows you to perform searches across the results of all plugins. Sometimes you may have a plugin that adds data that you do not want included in your search results. To achieve this you can use the filters page to disable WordPress filters when data is being indexed. This does not affect the plugin at any other time.

The list of filters will vary according to the theme and plugins you have installed:

filters

Note that this is an advanced feature – do not use unless you understand the effects.

Search Engines

A search engine provides search functionality. Search Unleashed has four search engines, each of which has advantages and disadvantages:

  • Default WordPress
  • Indexed WordPress
  • MySQL Fulltext
  • Lucene

A comparison of the engines is shown below:

Needs Indexing Include Plugins Logical Search Prioritization Medium
Default WordPress No DB
Indexed WordPress Yes Yes DB
MySQL Fulltext Yes Yes Yes Yes DB
Lucene Yes Yes Yes Yes File

You should select a search engine that provides features appropriate to your blog. The Lucene engine requires write access to your wp-content/cache directory and is file-based, whereas all other engines work directly from your database. All search engines will allow highlighting of search phrases.

Prioritization allows you to assign more weight to certain modules, which in turn affects the order of results – posts with more weight appear higher in results, posts with less weight appear later.

For example, you may decide that the title and URL should be more important than meta-data. In this instance you could change the priority of the title and URL module to have a higher priority than the standard 1.0. Setting a priority less than 1.0 will give it less weight.

Indexing

Depending on your choice of search engine you may need to index your database. This process runs through all your posts and stores the plugin-processed data in a separate search index. This process only needs to be performed once. Future modifications to posts will be automatically included in the index.

The default WordPress engine requires no indexing.

Indexing consists of visiting the search index page and pressing re-index button. Your database will then be indexed and a progress bar will show the state of this operation.

indexing

Search Log

Search Unleashed can be configured to record a log of searched phrases. This can be viewed from the log sub menu.

Log

Logical Searching

Search Unleashed tries to be as simple as possible for users performing searches and does not present a complicated set of search options. Instead a search is performed across all indexed data, and can be made using a similar syntax to what is used in popular search engines like Google or Yahoo.

Wildcards are supported through a *, but only when ‘full text’ searching is enabled:

head*

This will find all words that start with head.

Words can marked as required or not required using + and -:

+headspace - the word 'headspace' must exist
-headspace - the word 'headspace' must not exist

An exact phrase can be included by wrapping the phrase in quotes:

'exact search phrase'

Logical inclusion also works:

headspace AND plugin = +headspace +plugin

Here both headspace and plugin must exist.

Unlike some other plugins, Search Unleashed allows you to search for words smaller than four characters in length.

Incoming Results Template

Incoming results are highlighted using a default template. It is possible to change this template by performing the following steps:

  1. Create a directory view/search-unleashed inside your theme
  2. Copy the file wp-content/plugins/search-unleashed/view/search-unleashed/incoming_local.php to the newly created directory in your theme
  3. Modify the copied file as appropriate

Note that the template file is separate from the plugin so you can update the plugin without needing to update the template.

Support & Bugs

This plugin is no longer actively maintained

615 comments

  1. Hi there. I just installed the plugin and configured it appropriately, I belive. When I search for something and visit the page found, I am getting these errors:

    Warning: preg_match() [function.preg-match]: Unknown modifier ‘b’ in /xxx/blog/wp-content/plugins/search-unleashed/models/highlighter.php on line 30

    Warning: preg_replace_callback() [function.preg-replace-callback]: Unknown modifier ‘b’ in /home/j2eegeek/public_html/blog/wp-content/plugins/search-unleashed/models/highlighter.php on line 118

    Any ideas? I’ve disabled the plugin for now but would love to help dig into this issue. Thanks

  2. Hi Vinny, can you tell me what version of PHP and WordPress you are using, and the search phrase that caused the error?

  3. hello there.
    thanks for spending so much time on improving wordpress.
    my issue: your search unleashed plugin leads to an error message in the sidebar, where the search interface is located. maybe this is interesting for you.
    latest wordpress stable 2.2.2 is used and it happens no matter what search phrase is used.
    it says:

    Fatal error: Cannot redeclare class searchparser in /home/der-du-de/htdocs/wordpress/wp-content/plugins/search-unleashed/models/search_parser.php on line 4

  4. hello me again 🙂

    I get firebug errors when I try to reindex search unleashed… the buttons to reindex posts/pages and comments do not work, firebug says:

    $("#outer") has no properties
    index(0, "posts")admin.js (line 8)
    onclick(click clientX=0, clientY=0)edit.php (line 1)
    [Break on this error] $(‘#outer’).empty ();

    might be another plugin interfering?

  5. oh, and btw. all other ajax effects break too – i.e. I cannot set any options of the modules of your plugin 🙁

  6. Hi,

    I got the same error as derdude. Seems to be because search_parses.php is included twice, both from search_unleashed.php and spider.php . Changing those "include" commands to "include_once" got rid of the error, though I’m not entirely sure if it’s the most elegant way to do it.

    I do see a different error, when the search results are found inside the post title. Something in the parsing done in the "mark_words" function doesn’t work right, and it doesn’t identify/escape it properly. It tries to stick a "span" tag/wrap inside the "title" attribute of the "a" tag. Sample result (renamed the actual site):


    test post">Simple test post

  7. I think it would also be better if formatting/html from the post and comment text would not be stripped. Removing the tags causes the excerpt test to look different than it would in the post. Usually it’s minor thing like losing em/strong formatting, but it makes a mess of the output of plugins like WP-Footnotes or In Series.

  8. Hi, i had the same problem with WP 2.2.2.
    My fix was to add these two lines in highlighter.php on Line 30 (before the if (preg_match) call)

    $word = str_replace("/", "\/", $word);
    $word = str_replace(‘"’, ‘\"’, $word);

    after that the plugin works

  9. what about adding category search? WP default search uses the OR operator when it comes to cats, instead of AND.

  10. Version 0.1.1 released to address these problems. Note, please disable and re-enable the new version. You will need to rebuild the search index again

    Yaron, it would look better to include the formatting, but it is a very complex process that would require considerable coding and always be subject to special cases. WordPress doesn’t do it for this reason, neither do Yahoo or Google.

    There’s a new option that you will need to configure to enable correct display of highlighted titles (see ‘theme title position’).

    Tricky, do you mean restrict the search to certain categories? As far as I’m aware the default WordPress search doesn’t look at the category at all.

  11. Hi John,

    Thanks for the fixes, it seems to be working fine now.

    The code you suggest for adding to the wp-cache-config.php file needs to be tweaked a little, though.

    When changing the WP-Cache parameters through the admin interface, it modifies all occurrences of the matching parameter line in the file. So if the "$cache_enabled = false;" command is in it’s own line (preceeding spaces don’t seem to matter) it will get changed to " = true;" the next time you disable and re-enable the WP-Cache plug-in. Even if PHP knows it’s not a single command but continues something from the previous line. And even if it’s not the first occurrence on the file.
    I haven’t looked at the code, but I suspect WP-Cache simply matches all lines of the file with how it expects the parameter to look, and changes all copies.

    Moving it together with the condition, to be as a continuation in the same line, solves the problem. So instead of:

    if ($engine->is_incoming_search ())
    $cache_enabled = false;

    It should be:

    if ($engine->is_incoming_search ()) $cache_enabled = false;

    Personally I’m not too enthused with something that cares about newlines in a language that doesn’t care about them. But that seems to be the way WP-Cache parses the file when making configuration changes.

  12. It doesn’t seem to check for the case of a single letter search term.
    I tried searching with just the letter a, or b.
    Got this:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AND wp_search.post_id=wp_posts.ID AND wp_posts.post_status=’publish’ AND post_’ at line 1]
    SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_posts.*, ((0.6 * MATCH(content) AGAINST (” IN BOOLEAN MODE)) + (1.3 * MATCH(priority) AGAINST (” IN BOOLEAN MODE))) AS score, COUNT(post_id) AS multiple,MAX(wp_search.comment_id) AS comment_id FROM wp_search,wp_posts WHERE () AND wp_search.post_id=wp_posts.ID AND wp_posts.post_status=’publish’ AND post_password = ” AND post_date

  13. Sorry,

    i tought that this "issue" could be search related:

    http://www.blog.com/?cat=3,4,5 looks for articles in cats 3 OR 4 OR 5, i was wondering how i could get a match for 3 AND 4 AND 5

    is there any way your plugin could be used for "category" search? it’d be more of a sorting thatn searching.

  14. I’m playing with it now – very interesting! But I’m seeing a glitch with the Social Bookmarking Reloaded Plugin. When I land on the site from a Google search, its "expanding" the bookmarking icons, showing the associated text (not normally visible) and highlighting those as well.

  15. […] respect web sites where the search is giving me real answers. That is exactly what Search Unleashed is doing: takes you to the right page with the right search word, highlighted with the right color. […]

  16. Thanks for the WP-Cache tip, Yaron, I’ve updated the page to reflect this issue.

    Plugin updated to fix problem with Social Bookmarking plugin, and to allow one character searches.

  17. Hi there,

    Very interesting work! Congratulations. I’d like to review Search unleashed on my site.
    However, when I run the indexing after first install and activation of the plugin, I receive errors:

    INSERT INTO wp_search (post_id,content,priority) VALUE ('237',NULL,'File Icons 2.0')
    WordPress database error: [Column 'content' cannot be null]

    I am testing the plugin on following system:

    PHP information for

    max_execution_time: 150
    max_input_time: -1
    file_uploads: 1
    upload_max_filesize: 5M
    post_max_size: 8M
    register_globals: 1
    safe_mode:
    allow_url_fopen: 1

    Other information:

    WordPress Version: 2.2.3
    WordPress Blog URI: http://wordpress.designpraxis.at
    WordPress Installation URI: http://wordpress.designpraxis.at
    WordPress Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
    WordPress wp-content directory is writable
    WordPress does not use Gzip Compression
    WP-Cache ist running on this installation of WordPress
    GD library is installed
    PHP Version: 4.4.6
    MySQL Version: 5.0.37
    Browser used: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20061023 SUSE/2.0.0.5-1.1 Firefox/2.0.0.5

  18. Thanks for the detailed info Roland. It was a simple issue (- attachments have no content, and the database was assuming everything would have content) that I’ve fixed in 0.1.3. Please deactivate and then reactivate the new version to ensure the database structure is updated, and then you should be able to index without problems.

  19. Many thanks for this excellent plug-in.

    The one area where WordPress has always lagged behind is search and this just brings it into the real world with ease. Before this, I was having to use a Google search in an attempt to give users a reasonable service, but this is brilliant.

    Many thanks and best wishes. Would recommend to anyone.

  20. Thank you John, it works very well now.

    I’d suggest changing the wp-cache section a bit more, in case someone will remove search-unleashed in the future.
    Maybe something like :

    // Prevent incoming searches from being cached
    if (@include_once (ABSPATH.'wp-content/plugins/search-unleashed/models/search_engine.php')){
    if (class_exists('Search_Engine')){
    $engine = new Search_Engine ($_SERVER['HTTP_REFERER']);
    if ($engine->is_incoming_search ()) $cache_enabled = false;
    }
    }

    It may leave leftovers in the wp-cache config file, but at least it won’t stop the site from working.

    I find it strange WP-Cache doesn’t provide a more convenient way for other plug-ins to do this. Seems like an ideal place for them to call a special event/filter.

  21. Hi John,

    I think I found another small problem, involving the Recent Posts, and Pages, widgets.

    On a page with a list of search results, the items on the Recent Posts widget are the posts shown on the results page. The titles and the links are correct for them.

    When getting to an individual post page, where the plug-in shows the "Local Search Results" box, no post title is shown by the Recent Posts widget, and by the Pages widget. Looking at the outputted HTML they do output all the items in the "a" tags, they just don’t output the titles and send the closing "a" tag immediately after the opening one. So the list looks like it has a single empty item.

    These are the standard widgets that come with WordPress, tested on v2.2.3.

  22. Hi Yaron,

    I’m not seeing the same effect with the Recent Posts widget. For me, on a search page it shows the same as every other page – a list of recent posts. On the incoming search page it still shows these recent posts. By any chance is your recent posts widget in a sidebar on the left?

    A good suggestion on the wp-cache config issue, page updated.

  23. Some issues with this otherwise great plugin:

    – The help box is being shown when a search has been performed even if I go to a page or post that was not part of the search results
    – when searching from the edit documents panel in the administration, the tags are being shown in the titles, and search is not permormed on unpublished posts ase they used to

  24. Hi John,

    The sidebar is on the right. Both graphically with CSS, and it is outputted into the html page after the post body (which I assume is the important part). I tried editing the theme to output the sidebar before the page content, but that didn’t seem to change anything.
    I’ll try to look at it some more.

    There also seems to be a remaining problem with the titles. Setting the option of title position to "1" I see search results in the title properly highlighted on a search result page, but it’s wrong when clicking into an individual post. Setting it to "2" does proper highlighting on an individual post page, but doesn’t highlight the word in the search result page.
    Would it be possible to set a different value for pages with single posts and multiple posts?

  25. Hi John

    A really basic question, if I may: how do I set up the search form so as to call your app? I’m using Google now and would like to switch to your search plugin; do I use the standard WP search form (that I ditched for Google)?

  26. Okay: I figured out that the plugin works off the "regulation" searchform. Now my problem is that there’s no highlighting within search results. Searched-for words get highlighted in the titles, if they’re there; but there’s no contextual material in the search results (just titles and post metadata), and going to the pages found gives no highlighting at all. Is my layout or CSS is frustrating the plugin, or do you know of another reason why I might not be getting highlighting? And if it’s the former, i.e. my fault, how might I go about correcting it or accounting for my html and css?

  27. Manne, yep, that’s an unavoidable side-effect. Without using a lot of JavaScript there’s no way to know whether the incoming click was from a search link or otherwise. The other problem you reported has been fixed.

    Yaron, do you have this running on the net? If you send me a URL I’ll be able to take a direct look.

    Simon, glad you worked it out! The plugin just requires the standard WordPress search. Do you have the plugin running at slaw.ca? There I can see the highlighting working fine on the search results page, but with nothing showing on the subsequent found page. I don’t think it’s a CSS/theme issue, but it could be a clash with another plugin. Have a try disabling some of your other plugins and see if the terms are highlighted. If you have no luck then get back in touch and I’ll try and track it down.

  28. John, thanks, it’s working fine. I finally figured out that in the search.php file you’ve got to call the_excerpt. The model I was working from only called titles.

    But while I have you on the line: it seems occasionally to miss a word that I know is in a post. Just today I was looking for Bouck, a person’s name. It exists in the post but the app couldn’t find it. (I tried with quotes, capitalized, with the following period, etc. all to no avail.) Yet it handily finds everything else. What might cause it to be blind to some words?

  29. Hi there, I tried this plug-in and its working great. However, I think it conflicts with my related post plugin. Usually, my blog shows 5 related posts by default, but if the page came from a search, it will only display 1.

  30. When I go to the Manage/Search Unleashed page an error is displayed : Table ‘database.wp_search’ doesn’t exist.
    What do I have to do ?

    I wanted to try the plugin because with the standard search I’m not able to find words with special characters. Will your plugin be the solution for me ?

    Thanks in advance for your help

  31. Simon, I’ve added a ‘force display’ option now for themes such as yours (the same applies to the default theme too). I’m not sure why it won’t find ‘Bouck’ on your site. I’ve added the same word to one of my own posts and it was found. Is the text stored in a post like normal? Did you add it to an existing post and maybe the plugin didn’t catch the update?

    Laurent, it doesn’t look like the plugin installed the database. What version of WordPress are you using? It should be able to find accented characters, although I’m not sure about Asian characters. If you spot a problem then let me know and I should be able to fix it.

    Allen, which related posts plugin are you using?

  32. Hi John,
    I tried the latest (0.1.5) version of the plugin, with WP2.2.3 all seems ok, but I get an error message when I try a search. I tried cutting down the search places to just posts to limit possibilities?

    –> Unknown column ‘xposts.post_status’ in ‘where clause’

    I’m afraid I’m no good at MySQL and the like to try and investigate, but one thing I did notice is that the column referred to does not seem correct, the "x" character is just the last character of the table prefix from wp-config.php. In part of the problem query there seems to be a dodgy bracket "(" which has split off the rest of the table prefix from xposts.post_status

    Most of the other column names seem ok, but really I have little clue what I am looking at. Sorry.

    Any ideas?

  33. Bizarre! You mentioned about a dodgy bracket in the query. Does this mean a full error is shown? If so, can you send it to me? Also, what version of PHP and MySQL are you using?

  34. Hi John,

    I found I am getting the problems with another plugin installed, it seems to be Disclose Secret (v2.4 with a
    "hotfix" for recent versions of WP) causing issues, I found that if I deactivate Disclose Secret, the Search Unleashed seems fine.

    I’ll recreate the MySQL error and send it to you.

  35. Hi John,
    I have installed v0.1.6 and receive the following error (excerpt of it) when I re-index for the first time:

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘VALUE (‘2’,’This is an example of a WordPress page you could e]

    WordPress 2.2.3 (fresh, no additional plugins)
    PHP 4.4.6
    MySql 4.0.24

    What could be the reason?

  36. John,
    I have installed WP v2.2.2 on another server (PHP 4.3.11 MySql 5.0.18) and receive the same error as described in my comment above.

  37. YikYak, it looks to be a problem caused by the DiscloseSecret plugin. You’ll have to contact the author and ask there.

    Karimun, I don’t know why you are getting that problem. I’ve installed it on a fresh WordPress and everything works fine, and most other people here have also installed it without problem. This means the issue has to be something related to your setup. I’m curious as to why your hosts have either a very old version of MySQL, or a new version of MySQL but a very old version of PHP. I wonder if this might be related to the problem?

  38. Great plugin!!!

    I think I found a bug. Entering a single character (without quotes) like "(", ")", "[", "]", "+", "!", and so on produces the following error on top of the page:


    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND wp_search.post_id=wp_posts.ID AND wp_posts.post_status='publish' AND post_' at line 1]
    SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_posts.*, ((0.6 * MATCH(content) AGAINST ('' IN BOOLEAN MODE)) + (1.3 * MATCH(priority) AGAINST ('' IN BOOLEAN MODE))) AS score, COUNT(post_id) AS multiple,MAX(wp_search.comment_id) AS comment_id FROM wp_search,wp_posts WHERE () AND wp_search.post_id=wp_posts.ID AND wp_posts.post_status='publish' AND post_password = '' AND post_date

  39. You were right, John.
    On a third (!) server (PHP 5.1.2 and MySql 5.0.20) it seems to work like it should – tested with the latest WordPress beta version v2.3 beta3. Thank you for this great plugin.

  40. Is everything alright with the download for 0.1.7 because the files are not in a folder and I can’t activate the plugin – Plugin could not be activated because it triggered a fatal error. Previous versions worked fine.

  41. i tried this on my blog or around a thousand posts. it works nice BUT there is a bug… There are some posts that are not beng returned in the results. I even tried using the exact title in the search but to no avail. I even rebuild the index several times. I hope you can look into this I really like the plugin

  42. Found a bug in this one too: Warning: Division by zero in /Library/WebServer/Documents/wp/wp-content/plugins/search-unleashed/ajax.php on line 61

    Happens when I try to re-index the comments. Re-indexing posts. works fine.

  43. [this comment has also been emailed directly to you John. no need to reply to my email if you reply here.]

    hi John,

    thanks for creating this new plugin.

    i finally got around to testing it out this afternoon. unfortunately it didn’t work for me. i installed version 0.1.8 into a local WordPress 2.0.2 installation.

    the error i received occurred when i attempted to "Re-index posts":

    "Fatal error: Class ‘Search_Plugin’ not found in wordpress/wp-content/plugins/search-unleashed/ajax.php on line 19"

    is version 0.1.8 compatible with WordPress 2.0.2? on what versions of WordPress has ‘Search Unleashed’ be most heavily tested?

    also, on the "Search Index" configuration page it says:

    "Changes to individual posts & comments will be automatically re-indexed – you do not need to re-index after editing posts."

    does this mean that for the ‘Search Unleashed’ plugin to work properly the database needs to be manually re-indexed regularly if there are any new posts or comments?

  44. David, I’ve tested it as far back as WP 2.0.5. There should be no real differences between that and 2.0.2, and certainly not one that would create an error such as you reported.

    No, the text means you don’t need to manually reindex – changes to posts and comments will be automatically reindexed. The only clause is if you change or install additional plugins that may insert data into posts or comments.

    I’ve released 0.1.9 which adds WordPress 2.3 support for tag searching.

  45. Hi John,
    Sorry, busy week, I didn’t have time to get back to this.

    I downloaded the latest version (0.1.9), but it didn’t solve my two problems. So I did some investigating. I found the cause for one of the issues, but not for the second.

    1. Title highlights on single post view

    The problem was related to my theme calling the next_post_link and previous_post_link before displaying the permalink/title of a post (from single.php). After checking some themes I noticed that it only happened in those cases.

    I understand that the "Theme title position" parameter on the plugin basically refers to the count of times the_title() is called before it is processed for highlighting. Most themes call it once for the title attribute of the a tag, and a second time to display on the screen, so the default value of 1 will just highlight the displayed text.

    The problem was that previous/next_post_title apparently also call the_title(), or whatever it is inside the_title() that the plugin process. So on the last, or first, post, one time will go for the previous/next link, and the plugin will try to highlight the title attribute on the a tag, instead of the displayed title, those "breaking" the displayed link. And on any other post the_title() would be called twice before getting to the actual title, and nothing will be highlighted.

    On themes that did not show the next/previous links, this of course didn’t happen. But it happens on every one that does.

    For now I changed my theme’s single.php to get the title, twice (title attribute and displayed text), into variables, then show the next/previous links as normal, and then use the new variables to build the title/permalink line at the top of the post. This works fine, since the_title() is always called as expected.
    But if there’s a way to account for that in the plug-in itself it would be much better, otherwise almost any theme with prev/next links will need to be modified.

    Also, I noticed that the plugin process the_title(), but not single_post_title(). The latter isn’t used on any themes I actually checked so far, but it exists, and the WordPress codex actually recommends using it for single posts, so it may be a good idea to support it as well…

    2. Recent Posts sidebar widget changes on search result page.

    I’m still having this problem. It happens with every widget-enabled theme I checked (about 10-15 so far, some very common), when using only standard widgets that came with WordPress, and with no other plugin active except Search Unleashed.

    Something did improve by 0.1.9 since now this only happens on the search result page (showing multiple posts, when searching from the WordPress blog itself), and not on individual posts that were reached through a search. Previously it happened on both.

    Instead of showing the recent posts on the blog, after running a search it shows the recent posts that are in the search result, and ignores any other posts.

    If you cannot reproduce it, I have a testing installation used to check WordPress updates and plugins, installed on http://www.ordinarynothing.org/testblg/
    It is alongside a personal blog, and using the same theme and plugins. But as I wrote this behaviour does happen with other standard themes, and with no other plugins active.
    You can see the Recent Posts on the sidebar. Notice the change after running a search.

  46. And I also have a minor feature request, in addition to the buttons to reindex posts and reindex comments, add the option to reindex both.
    Or at least don’t hide the buttons after one of the is pressed.

    This is only relevant when deactivating, and afterwards reactivating, the plugin. It always starts with a clean index, so the first thing to do is go and reindex everything. Having to refresh the page after reindexing the posts, because the button to reindex comments has disappeared, is a little bit annoying.

    Like I said, minor, and not urgent. The plugin is rally good, so once the remaining bug is sorted out I expect to only deactivate and reactivate on updates.

    Thanks, in any case.

  47. I have installed the plugin and after having a slight problem with the highlighting and finally getting that figured out, it seems that it is not re-indexing on it’s own.

    It’s not indexing any news posts or new comments after I’ve done the initial index. To get them to show up I have to re-index again.

    It finds words edited into posts that already existed before I initially indexed but it finds nothing in any new post or new comment without me having to re-index them.

    This surely can not be how this was meant to work.

  48. The ability to download your plugins (e.g. Search Unleashed) seems to be broke right now? I get redirected to a 404 page.

  49. Thank you for a great piece of code. Thank you.

    Bug report: This plugin cannot "re-index" in Mac OS X’s Fireforx. It works well in PC’s Firefox.
    It does not work in safari or IE. Just FYI. Hope you can put this in your installation notes.

  50. Jessica, the plugin should work in all browsers. It has been developed on Mac Firefox, and tested in Safari and IE, and works the same in each for me. What is happening for you?

    Chuck, try again, I upgraded to WP 2.3 and things went a bit screwy for a while.

    Yaron, you can actually press on the reindex status and it will bring back the original re-index buttons. The recent posts widget should now function correctly.

    Scott, no, that’s not how it should work. Try the new version

  51. Hi John,

    I have a question for you: do you great plugin enhance the «search» into «manage» area in backoffice? I guess not, since the same search shows more posts in the website than in the «manage» area.
    Is there a way to do that?

    Thanks!

  52. How can I change the code so that "editor" level user, will get to see the "Search Unleashed" tab?

    Thank you.

  53. Thank, John!
    Seems to work perfectly now, apart from the title prev/next issue, and since my current themes have a workaround I’m personally good with it.

  54. Oh, and it’s off-topic, but your per-post comment feeds on the site are broken again, going to the main feedburner feed for the site.

  55. Thanks for a great plugin! I have the latest version (as of 25 sep07) and WP 2.2.

    I have two questions / observations:

    1. After installing the plugin there seems to be a problem saving posts or pages. Instead of being redirected to the main post list (or the current post for further editing) I get a browser window showing only the post_content. When auto saving, the entire post_content is displayed as an error.

    2. In the resulting database table (after using the reindex posts button) the ‘Priority’ column contains the post/page titles but the content column is null for every entry. Maybe these two problems are related? For now I’ve created a separate script to populate the table and the search works great.

    Thanks again for a great plugin!

  56. Hi Art, I can’t reproduce the effect you’re seeing. Do you have any other plugins installed that might hook into the save process?

  57. Hi John,

    How do I change the code, so that "Editor" level will get to see "Search Unleashed" tab?

    Thank you.

  58. Jessica, currently you can’t do this without editing the plugin and replacing all occurrences of ‘administrator’ with ‘edit_posts’

  59. > on Sep 26, 2007 2:39 am, Jessica Koh wrote:
    >
    >> How do I change the code, so that "Editor" level will
    >> get to see "Search Unleashed" tab?

    on Sep 26, 2007 3:13 am, John (author) wrote:

    > Jessica, currently you can’t do this without editing
    > the plugin and replacing all occurrences of
    > ‘administrator’ with ‘edit_posts’

    i’d like to make this change also. will there be any unwanted consequences to replacing ‘administrator’ with ‘edit_posts’?

  60. David, there should be no unwanted consequences (other than editors being able to re-index). I should add that you’ll need to do the same replace operation in ajax.php.

    I’ll add this as a feature in the next version so you won’t need to go hacking code.

  61. Thanks John,

    You’re absolutely right. There’s a conflict with the ‘Inline Ajax Page’ (INAP) plugin. Search Unleashed works fine when INAP is disabled. I don’t have time today to figure out where the problem is but I’ll look into it and report back.

    Thanks again!

  62. I’ve been using this plugin for some time now on a few blogs, and it’s excellent. Even got some thank you notes for enabling this plugin from a few users because they can finally find things now. 🙂 (I host and maintain some community blogs with LOTS of posts).

    I did notice however that some pages sometimes seem to be ignored in the results. I did exclude some pages and posts (results for posts you don’t have a password for are not so useful), but it also seems to exclude pages that are not on the exclude list.

  63. Suggestion: Dunno if this would be useful to many people, but it’d be cool if highlighting the keywords in results could be turned off for the post titles, i.e. only keywords in the body text would be highlighted. In my theme, the titles white on a background color while the body text is black on white, the highlighting looks, not to mention hard to read. I’ve gotten around this for now by turning off the Post title module…

  64. The plugin installs fine, but I am getting an error when I try to index the posts that says "
    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Value (‘ "
    etc.

    This does not occur when I index the comments.

  65. It’s useful plug-in !, It does not work when search keywords are double byte character, for example Korean language. How can I fix it?

  66. Hi John,

    I installed the plugin and everything seems to be working fine except when I try to save a post in the WordPress editing screen (Manage -> Posts). Instead of being brought back to the list of posts as usual, I get a screen with some of the post content and nothing else. I’m using WordPress 2.3.

    Can you help out?

    Thanks!

  67. Hi – when the search fails, there are no results and I go to another page (click on the page name) incoming_local.php seems to be included on that page and a "Local Search Results" box is displayed at the top. Is there some way to avoid this? – nice code – Thanks.

  68. Aseem, do you have the Inline Ajax Page plugin installed? If so that plugin currently clashes with Search Unleashed (see comment 61 & 68)

    Chuck O, the incoming highlighting works on the page referrer. As such there’s no way to tell what was on the referring page, other than it was a search page. The only solution would be to use cookies, but this seems very messy.

    Dobiho, I’ll have to look into why multi-byte searching isn’t working

    Jane, it’s probably another plugin clashing with Search Unleashed. If you have Inline Ajax Page installed then that is a likely culprit.

  69. Colin, is there anything different about the pages that are missing? For example, are they marked as draft or private, are they set in the future etc?

  70. Hello, I was wondering if there was any way the display of search results can be altered: for example, to have the full post displayed, or to have the results displayed as a list with their titles and excerpts only. Thank you.

  71. I’m generally more than happy with this plugin. It’s made my blog much more useful. But I’m puzzled by the fact that occasionally it fails to find a word — one that is in fact in the post. I’ve tried to account for case sensitivity and punctuation, but I can’t figure out why it would miss on one word and hit on another, when both are in the same post.

    I’ve put this as generally as I have because I can’t tie to to anything more helpfully specific: and so I wonder: is there a known problem that will cause this erratic success/failure? (I’m using WP2.2, by the way.)

    Cheers,

  72. Tommy, the way the results are displayed is largely determined by your theme. The plugin can be configured to ‘force’ display of results as some themes (specifically the default one) only show a list, although your theme does not appear to be like this. If the output is appearing twice then it’s likely to be something in your theme that I’ve not handled in the plugin. If you let know what theme you are using (or send me a copy) I’ll investigate and remove the duplication.

    Simon, are the words found if you reindex? I know that MySQL automatically filters out certain words it deems unnecessary, but judging from your previous message I don’t think ‘Bouck’ is one of them. If I can reproduce the same effect on my development site then I’ll be able to track down the missing words, but until then it’s going to be difficult. If you can think of any plugins you have running that might affect posts then that will help.

  73. I too am having issues with words and phrases that definitely exist NOT coming back in the results. It makes the plug-in pretty much useless. Any ideas what the problem is for us?

    Thanks!

  74. Matt, the same as I said for Simon. If you can provide some more details about post content, search words, and any other plugins, then I can try and look at why certain words are being excluded. Until I can reproduce it myself I can’t do anything about it.

  75. I’ve sent you a copy of my search.php via the contact form on the site. The theme I’m using is WordPress Default 1.6. Thanks for looking into it.

  76. John,

    If you go to my site at http://www.superconductorweek.com and on the page is a post called "Superconductor Week No. 2117", within that post is the text "MgB2" for example. search for that, no results.

    I have tried a lot of random searches for text i pulled straight from posts that sometimes provide no results.

    Plugins I have installed are:

    All in one SEO
    Google Sitemaps
    Google Analyticator
    WP-Sticky
    WP Super Edit

    Thanks!

  77. the plugin is really good, but it doesn’t seem to search in password-protected posts which makes it essentially useless to me. Is there a way of getting it to look in those posts?

  78. I’m having another exclusion type of problem. It seems the search is randomly (?) returning some BUT NOT ALL posts where the search string is part of a word…

    On the word "sunflower", I found a number of entries, including ones with "sunflowers" (plural). Then, search for "sunflowers", I found additional posts that weren’t included in the "sunflower" search.

    The same for "beet" and "beets". The beet search turned up, for example, a post that only contained "beetle", but the search for "beets" resulted in additional posts with pluralized beets.

    I’ve turned off Search Unleashed and got consistent results with WP default search. I’ve also reindexed SU several times. The returned results are also all the same each time, and I can’t find anything at all unusual about the various posts (text formatting, special characters).

Comments are closed.