Continue reading Using phrases in Related posts searches

Using phrases in Related posts searches

I have a book review site where I’m using Relevanssi Premium and the Related posts to highlight related book reviews. The reviews have multiple taxonomies used for the related posts: tags, book author, series, characters, and places. Messy relations The problem is, with the default settings, the Related posts get a bit messy. This site…

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
Continue reading Debugging indexing problems

Debugging indexing problems

The easiest way to debug indexing problems is to use the WP CLI tools available in Relevanssi Premium. To see how Relevanssi sees the post 123, just use the following command on the command line: This will print out how Relevanssi sees the post, how it appears in the different steps of the indexing process…

Read more Debugging indexing problems 2 Comments on Debugging indexing problems
Continue reading Pinning and exclusion doesn’t work for custom post types in Gutenberg

Pinning and exclusion doesn’t work for custom post types in Gutenberg

Sometimes when you try to access the pinning or the exclusion settings for a custom post type post in the Relevanssi Gutenberg sidebar, you come across this error message: If you copy the error, the relevant beginning will look like this: Error: An error occurred while running ‘mapSelect’: Cannot read property ‘_relevanssi_pin_keywords’ of undefined The…

Read more Pinning and exclusion doesn’t work for custom post types in Gutenberg 0 Comment on Pinning and exclusion doesn’t work for custom post types in Gutenberg
Continue reading Wishlist Member: Sorting the posts by membership levels

Wishlist Member: Sorting the posts by membership levels

Someone wanted a way to prioritize posts that are targeting particular Wishlist Member membership level. The basic implementation here is simple: create a relevanssi_hits_filter function that will sort the posts by the level. There’s a trick to this, though, as Wishlist Member does not provide a way to check the level of one post. There’s…

Read more Wishlist Member: Sorting the posts by membership levels 0 Comment on Wishlist Member: Sorting the posts by membership levels
Continue reading Partial matches to just one custom field

Partial matches to just one custom field

Is it possible to set (with filters and/or actions/functions) Relevanssi to use whole words keyword matching for post titles and 2 custom fields, and partial keyword matching only for a specific custom field (sku in this case)? Indeed it is! That is, you can’t set different keyword matching methods to different parts of the post,…

Read more Partial matches to just one custom field 0 Comment on Partial matches to just one custom field
Continue reading Excluding old content from the search

Excluding old content from the search

Is there a way to exclude anything before 2016 from search results? Yes. There are two approaches to this. If you never want to see anything old in the results, it’s best to filter in indexing with relevanssi_indexing_restriction. Add this to your site: Note that the restriction explains which posts are included in the index,…

Read more Excluding old content from the search 0 Comment on Excluding old content from the search
Continue reading Restrict search by author from the search query

Restrict search by author from the search query

You can set Relevanssi to index the post author, which will then let you find posts by searching for the name of the author. But what if you want a stricter filter? Where searching for an author would only show posts by that one author and nothing else? That’s possible too. Add this function to…

Read more Restrict search by author from the search query 0 Comment on Restrict search by author from the search query
Continue reading Target specific part of the post

Target specific part of the post

Relevanssi Premium 2.4.4 introduced a new feature where you can target specific parts of the post straight from the search terms. The format for this is {target:search_term} Target can be one of the following: title: Post title. content: Post content. author: Author display name. comment: Comment text. link: Link from another post. excerpt: Post excerpt.…

Read more Target specific part of the post 3 Comments on Target specific part of the post