Continue reading WooCommerce 4.4 problems

WooCommerce 4.4 problems

Updating WooCommerce to version 4.4 breaks Relevanssi searches. After updating WooCommerce to version 4.4, Relevanssi searches no longer find results. This problem is caused by changes in WooCommerce. Those who are interested in the details can go read the GitHub issue I created. For those interested in solving the problem, the next version of Relevanssi…

Read more WooCommerce 4.4 problems 7 Comments on WooCommerce 4.4 problems
Continue reading Relevanssi and languages

Relevanssi and languages

Relevanssi is language-agnostic in itself. It does not know any language and doesn’t care about which language the site uses. However, there are a few things that you need to consider when using Relevanssi in languages other than English. Characters: use UTF8 As long as your site uses UTF8 characters, Relevanssi can handle just about…

Read more Relevanssi and languages 17 Comments on Relevanssi and languages
Continue reading Indexing only attributes from shortcodes

Indexing only attributes from shortcodes

I need to add some custom shortcodes to the list of the “removed” ones (so they don’t show in plain text in the results). However, some of them are built like [shortcode_name text=”Need to keep this in results”] and I would like the content in the text parameter to stay in the results. How do I go about this?…

Read more Indexing only attributes from shortcodes 0 Comment on Indexing only attributes from shortcodes
Continue reading Boosting shorter posts with higher keyword density

Boosting shorter posts with higher keyword density

By default, Relevanssi tends to prefer longer posts. The default TF × IDF weights Relevanssi uses simply count the term frequency, ie. how many times a word appears in the post. That prefers longer posts as they usually have the search term appear more often. However, a 500-word post with 15 search term appearances might…

Read more Boosting shorter posts with higher keyword density 0 Comment on Boosting shorter posts with higher keyword density
Continue reading WooCommerce: Return only exact matches for SKU searches

WooCommerce: Return only exact matches for SKU searches

This little filter function works on relevanssi_hits_filter. When a search query is made that matches an SKU (or any other custom field, but SKUs are the most likely scenario here), only results that match the SKU will be returned. For this to work, Relevanssi must be set to index the _sku custom field (because otherwise,…

Read more WooCommerce: Return only exact matches for SKU searches 1 Comment on WooCommerce: Return only exact matches for SKU searches
Continue reading Premium 2.8 / Free 4.7

Premium 2.8 / Free 4.7

These versions add new features, but these are mostly small and of interest to developers. As a big change Relevanssi is now active in Media Library searches in the admin backend (if admin searches are enabled): feedback on this is welcome. Excerpts should be slightly better, especially when content stopwords are involved and post part…

Read more Premium 2.8 / Free 4.7 2 Comments on Premium 2.8 / Free 4.7
Continue reading Using phrases in Related posts searches

Using phrases in Related posts searches

…global $post; $characters = rlv_process_terms( $post, ‘characters’, ‘restrict_to_taxonomy’ ); $authors = rlv_process_terms( $post, ‘authors’, ‘restrict_to_taxonomy’ ); $locations = rlv_process_terms( $post, ‘locations’, ‘restrict_to_taxonomy’ ); $series = rlv_process_terms( $post, ‘series’, ‘restrict_to_taxonomy’ ); $tags = rlv_process_terms( $post, ‘post_tag’, ‘just_add_phrases’ ); $new_words = array_merge( $characters, $authors, $locations, $series, $tags ); return $words . ‘……look at that next: function rlv_process_terms( $post, $taxonomy, $process = ‘restrict_to_taxonomy’ ) { $terms = get_the_terms( $post, $taxonomy ); $term_names = array(); $callback = ‘rlv_phrasify_taxonomify’; if ( ‘just_add_phrases’ === $taxonomify ) { $callback = ‘rlv_phrasify’; } if ( $terms ) { $term_names = array_map( $callback, array_map( function( $term ) {……Wimsey and so on. Phrase search for multi-word taxonomy terms was required. Then the taxonomy restriction wouldn’t be necessarily required – it doesn’t matter where in the post “Lord Peter Wimsey” is mentioned, it’s definitely related. The relevanssi_related_words hook Relevanssi Premium gives us enough filter hooks to make building this…

Read more Using phrases in Related posts searches 0 Comment on Using phrases in Related posts searches
Continue reading Relevanssi indexes excluded posts

Relevanssi indexes excluded posts

Sometimes it can happen the search results include posts from a post type that has been excluded from the index. When that happens, here are things you can check. Are you using Relevanssi? It’s possible your search results are not coming from Relevanssi. The quickest way to check is to use the Relevanssi admin search…

Read more Relevanssi indexes excluded posts 3 Comments on Relevanssi indexes excluded posts
Continue reading Indexing product codes with and without spaces

Indexing product codes with and without spaces

A Relevanssi Premium customer had a problem with product codes. The codes are in the format “ABC 100”, a group of letters and digits with a space in between. Users may search for the codes without the space, so the post should be found with “ABC 100” or “ABC100”. The product codes don’t appear in…

Read more Indexing product codes with and without spaces 10 Comments on Indexing product codes with and without spaces