Relevanssi replaces the default search with a partial-match search that sorts results by relevance. It also indexes comments and shortcode content.
|Author:||Mikko Saari (profile at wordpress.org)|
|WordPress version required:||4.0|
|WordPress version tested:||5.0.3|
|Added to WordPress repository:||30-06-2009|
|Total downloads:||2 397 001|
|Active installs:||100 000+|
Click to start download
Excerpts and highlights
You can find solutions and answers at the Relevanssi Knowledge Base.
Answers to many common problems can be found from the contextual menu. Just click “Help” in the top right corner of your WordPress admin dashboard on the Relevanssi settings page.
Relevanssi doesn’t work
If you the results don’t change after installing and activating Relevanssi, the most likely reason is that you have a call to
query_posts() on your search results template. This confuses Relevanssi. Try removing the
query_posts() call and see what happens.
Searching for words with ampersands or hyphens doesn’t work
Please read Words with punctuation can’t be found. This is a Relevanssi feature, but you can fix it from Relevanssi indexing settings.
Where are the user search logs?
See the top of the admin menu. There’s ‘User searches’.
Displaying the relevance score
Relevanssi stores the relevance score it uses to sort results in the $post variable. Just add something like
to your search results template inside a PHP code block to display the relevance score.
Did you mean? suggestions
Relevanssi offers Google-style “Did you mean?” suggestions. See “Did you mean” suggestions in the Knowledge Base for more details.
What is tf * idf weighing?
It’s the basic weighing scheme used in information retrieval. Tf stands for term frequency while idf is inverted document frequency. Term frequency is simply the number of times the term appears in a document, while document frequency is the number of documents in the database where the term appears.
Thus, the weight of the word for a document increases the more often it appears in the document and the less often it appears in other documents.
What are stop words?
Each document database is full of useless words. All the little words that appear in just about every document are completely useless for information retrieval purposes. Basically, their inverted document frequency is really low, so they never have much power in matching. Also, removing those words helps to make the index smaller and searching faster.
- Improvements to meta key sorting.
- Relevanssi settings page won’t let you exclude categories you have restricted the search to.
- Members plugin compatibility has been improved: it’s only used if the ‘content permissions’ feature has been enabled.
- The excerpt settings page was a bit buggy.
- Slimstat analytics is now added to the blocked shortcodes list.
- New filter:
relevanssi_search_formworks exactly like
get_search_form, but only applies to the Relevanssi shortcode search forms.
- New JetPack taxonomies and post types have been added to the block list so they won’t appear in Relevanssi settings.
- Choosing “CSS Style” for highlighting was not possible. That is now fixed.
- Gutenberg reusable block indexing was fatally broken with the latest Gutenberg version. That has been updated.
- Relevanssi now by default respects the WooCommerce “exclude from search” setting.
post__not_instill didn’t work properly, it does now.
- New filter:
relevanssi_comparison_ordercan be used to define the sorting order when sorting the results by post type.
- “Did you mean” process included a very slow query. It is now cached, leading in some cases to massive performance improvements (we’re talking about several seconds here).
- Highlights inside
codeand similar blocks are handled better now.
- Fixes the broken User searches page.
- Adding the missing Gutenberg compatibility file.
- Relevanssi can now index Gutenberg reusable blocks. (This functionality broke once already before release, so that can happen, since Gutenberg is still in very active development.)
post__not_inparameters didn’t work, and are now fixed.
post_parent__not_inare also improved.
- You can use named meta queries for sorting posts. Meta query sorting is improved in other ways as well.
- Log export didn’t work properly.
- Adding stopwords from the common word list has been fixed.
relevanssi_get_words_havingfilter hook is now also applied to the free version Did you mean queries.
- New filters:
relevanssi_7dayscan be used to adjust the number of days for log displays, so instead of 1, 7 and 30 days you can have anything you want.
- Actually working admin search.
- New feature: You can now export the search log as a CSV file.
- New feature: Admin Search page allows you to perform searches in WP admin using Relevanssi.
- New filter:
relevanssi_admin_search_capabilitycan be used to adjust who sees the admin search page.
- New filter:
relevanssi_entities_inside_codeadjust how HTML entities are handled inside
- Numeric meta values (
meta_value_num) are now sorted as numbers and not strings.
- Pinned posts have
$post->relevanssi_pinnedset to 1 for debugging purposes, but you can also use this for styling the posts in the search results templates.
- The Did you mean feature has been toned down a bit, to make the suggestions slightly less weird in some cases.
- Post parent parameters now accept 0 as a value, making it easier to search for children of any post or posts without a parent.
- Polylang compatibility has been improved.
- Phrases with apostrophes inside work better.
relevanssi_excerptfilter hook got a second parameter that holds the post ID.
- Custom field sorting actually works now.
- WP Search Suggest compatibility added.