Continue reading Debugging slow searches

Debugging slow searches

Reasonable expectations for Relevanssi searching speeds are measured in seconds. Relevanssi does not generally return results in milliseconds. On the other hand, the searches shouldn’t take more than few seconds in most cases. Multisite searches are a different thing: even if the searching is reasonably fast, searching across many sites will always be slow. Doing…

Read more Debugging slow searches 0 Comment on Debugging slow searches
Continue reading Indexing term descriptions for posts

Indexing term descriptions for posts

Sometimes it is helpful to have Relevanssi index the taxonomy term descriptions for posts. For example, the term description can be a good place to add alternate search terms for the term. By default, Relevanssi only indexes the term name, so you need extra code to get the term descriptions. The filter hook relevanssi_content_to_index is…

Read more Indexing term descriptions for posts 0 Comment on Indexing term descriptions for posts
Continue reading Problems with highlighting in post content

Problems with highlighting in post content

Versions 2.27.5 (Premium) and 4.24.4 (free) added extra security to highlighting search terms in post content. Before that, an attacker with contributor access could inject malicious content in the posts and the highlighting would then trigger that. This is now fixed, but the fix comes with a cost: the post content is passed through the…

Read more Problems with highlighting in post content 0 Comment on Problems with highlighting in post content
Continue reading Integrating Post Views Counter stats

Integrating Post Views Counter stats

It’s possible to integrate all kinds of external data to Relevanssi weights. Post Views Counter is an analytics plugin that collects stats about your visitors and stores them in the local database, which means those stats are available for Relevanssi. For some sites, this makes a lot of sense. For example, I have Kirjavinkit, a book review site…

Read more Integrating Post Views Counter stats 0 Comment on Integrating Post Views Counter stats
Continue reading GeneratePress: Query Loop

GeneratePress: Query Loop

Relevanssi doesn’t work automatically with the Query Loop block in GeneratePress and GenerateBlocks. Fortunately, the solution is simple: the Query Loop block has a filter hook for adjusting the query parameters, and you can use that filter hook to enable Relevanssi. Add this to your site: Thanks to Ben Knowles. If you are using V2…

Read more GeneratePress: Query Loop 0 Comment on GeneratePress: Query Loop
Continue reading Year filter from the search query

Year filter from the search query

A good question was asked in the post Natural-language date queries: Is it possible to extend this so that I can simply add a the year in the search and only results from that year would show? The answer is yes! Add these functions to your site: The code consists of two functions. The first…

Read more Year filter from the search query 0 Comment on Year filter from the search query
Continue reading WooCommerce: Aelia Prices by Country product visibility

WooCommerce: Aelia Prices by Country product visibility

Aelia has a Prices by Country for WooCommerce plugin, which can adjust prices based on customer country and hide products unavailable in a specific country. Jason James shared a function that makes Relevanssi hide unavailable products in search: This function uses the relevanssi_post_ok filter hook to control which posts are included in the search and…

Read more WooCommerce: Aelia Prices by Country product visibility 0 Comment on WooCommerce: Aelia Prices by Country product visibility
Continue reading PublishPress Revisions: duplicate posts

PublishPress Revisions: duplicate posts

PublishPress Revisions causes duplicates to appear in Relevanssi search results when a revision is approved. When the revision is created, Relevanssi indexes it because it has the same post type as the original post with the post status draft. Relevanssi indexes drafts because people may want to search for them in the admin search. This is…

Read more PublishPress Revisions: duplicate posts 0 Comment on PublishPress Revisions: duplicate posts
Continue reading Korean postpositions

Korean postpositions

Korean has postpositions, which complicate things for Relevanssi. Fortunately, it’s easy to clean up the most common postpositions from the words. Add this function to your site: After you’ve added this function, rebuild the index. You also need to adjust the minimum word length to 2, as many Korean words are only two characters long.…

Read more Korean postpositions 0 Comment on Korean postpositions