Plugin Directory

Relevanssi

Author: Mikko Saari

Relevanssi replaces the basic WordPress search with a partial-match search that sorts the results based on relevance. It is a partial match search, so if user inputs several search terms, the search will find all documents that match even one term, ranking highest those documents that match all search terms.

Relevanssi does some fuzzy matching too, so if user searches for something that doesn't produce any results, Relevanssi will look for similar terms. Strict phrases using quotation marks (like "search phrase") are supported.

The matching is based on basic tf * idf weighing, with some extra features added like a boost for words that appear in titles.

In general the plugin doesn't affect the display of search results at all - that is left for the search result template to decide. However, if the option is set, Relevanssi will create custom search result snippets that show the part of the document where the search hit was made. Relevanssi can also highlight the query terms in the search results.

Relevanssi can keep a log of user queries and display both most popular queries and recent queries that got no hits. The logging is a new feature that will be refined later.

Relevanssi supports the hidden input field cat to restrict searches to certain categories (or tags, since those are pretty much the same). Just add a hidden input field named cat in your search form and list the desired category or tag IDs in the value field. You can also set the description from general plugin settings (and then override it in individual search forms with the special field).

In addition of post and page content, Relevanssi can index comments and pingbacks. It can also expand shortcodes in post content before indexing, so that everything the user sees on the entry page will be included in the index.

Relevanssi owes a lot to wpSearch by Kenny Katzgrau.

I know the plugin works with WP 2.5, but it loses some non-essential functionality. The shortcode stuff doesn't work with WP 2.5, which doesn't support shortcodes. Compatibility with older versions of WP hasn't been tested.

Tags: ,