Continue reading Restricting Did you mean suggestions to one post type

Restricting Did you mean suggestions to one post type

Sometimes it may be necessary to restrict the Did you mean suggestions Relevanssi serves to just one post type. There’s no option for that, as by default the Relevanssi database the Did you mean suggestions use as a source (this only applies to Premium, that is) doesn’t have any information about the post types the…

Read more Restricting Did you mean suggestions to one post type 0 Comment on Restricting Did you mean suggestions to one post type
Continue reading Results are in strange order

Results are in strange order

If best results don’t come up first and changing weighting settings doesn’t seem to make any difference, there couple of things you can do. Is Relevanssi active? The first thing is to check if the results are actually provided by Relevanssi. If you disable Relevanssi, do the results change? Do you see Relevanssi-generated excerpts? There…

Read more Results are in strange order 3 Comments on Results are in strange order
Continue reading Indexing custom post statuses

Indexing custom post statuses

If you’re using custom post statuses, Relevanssi requires some tinkering. By default, Relevanssi only handles posts that are of status publish, pending, draft or private. Relevanssi has a filter that lets you add more statuses to the list of acceptable statuses for Relevanssi. Add this to your site: This function, added to the two filters,…

Read more Indexing custom post statuses 4 Comments on Indexing custom post statuses
Continue reading Yoast Local SEO

Yoast Local SEO

Yoast Local SEO plugin breaks Relevanssi search. It enhances the search by adding meta queries. Unfortunately they don’t work with Relevanssi. The fix is simple, though. Add this to the theme functions.php: add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_meta_fix’, 99 ); function rlv_meta_fix( $q ) { $q->set( ‘meta_query’, array() ); return $q; }add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_meta_fix’, 99 ); function rlv_meta_fix(…

Read more Yoast Local SEO 14 Comments on Yoast Local SEO
Continue reading Adding extra weight to AND results in an OR search

Adding extra weight to AND results in an OR search

My Relevanssi engine has the AND operator enabled, with a fallback to OR when the search finds no matches. I’d like the search to display first the AND results and later the OR results. For example, if I search for “wedding party”, I’d like the search to show first the entries matching both words and…

Read more Adding extra weight to AND results in an OR search 0 Comment on Adding extra weight to AND results in an OR search
Continue reading Adding a custom field filter in the search

Adding a custom field filter in the search

Adding a custom field filter in a Relevanssi search takes a little bit of programming, because the filter needs to create a meta_query that Relevanssi understands. Let’s assume we have some colour information in a custom field that’s called colour_field, and we want to use that to filter the search results. First, let’s add a…

Read more Adding a custom field filter in the search 48 Comments on Adding a custom field filter in the search
Continue reading WooCommerce: Popularity and price sorting

WooCommerce: Popularity and price sorting

Many WooCommerce users use search sorting that allows users to sort by popularity or price. Unfortunately, while Relevanssi works fine with WooCommerce, those sorts do not work. Relevanssi doesn’t know about price or popularity, and the sorting assumes there’s a default WP search underneath. Relevanssi doesn’t do meta field sorting as easily as the default…

Read more WooCommerce: Popularity and price sorting 39 Comments on WooCommerce: Popularity and price sorting