Continue reading Premium 1.4.5

Premium 1.4.5

Here’s what Relevanssi Premium 1.4.5 has: New filter: relevanssi_match allows you to weight search results. Similar to cats vs cat, you can now use post_types to restrict the search to multiple post types. Multisite search supports post type restriction. The relevanssi_match filter is a really cool new feature that’ll give you lots of extra power…

Read more Premium 1.4.5 0 Comment on Premium 1.4.5
Continue reading Custom weighing with relevanssi_match hook

Custom weighing with relevanssi_match hook

If you want to fine-tune the post weights, version 1.4.5 introduces a new hook for that. The relevanssi_match hook lets you modify the matches found for queries. It passes a match object, which has the post id ($match->doc), number of hits found in different parts of the post and the weight assigned to the post…

Read more Custom weighing with relevanssi_match hook 64 Comments on Custom weighing with relevanssi_match hook
Continue reading Changing the number of search results displayed

Changing the number of search results displayed

A standard way to change the number of search results displayed is something like this: $myquery = "&posts_per_page=5"; $myquery = $query_string.$myquery; query_posts($myquery); $myquery = "&posts_per_page=5"; $myquery = $query_string.$myquery; query_posts($myquery); Unfortunately, this breaks Relevanssi. Relevanssi hasn’t played nice with posts_per_page in any case, for some reasons I don’t really understand — this is legacy code from…

Read more Changing the number of search results displayed 47 Comments on Changing the number of search results displayed
Continue reading Premium 1.4.3

Premium 1.4.3

Another quick bug fix. Fixed the Did you mean -feature, which was broken by the database change. WordPress doesn’t support searching for multiple categories with the cat query variable. There’s now new cats, which can take multiple categories as a comma-separated list. For some reason, WordPress doesn’t take arguments like ?s=term&cat=1,2 but strips the ‘,2’.…

Read more Premium 1.4.3 0 Comment on Premium 1.4.3
Continue reading Search results breakdown by type

Search results breakdown by type

Do you want to have a breakdown of search results by post type? This could be used for example to show a list of post types like books, movies, albums on a review site, and make them links to limit the search results to that post type. This is fairly easy to do with the…

Read more Search results breakdown by type 31 Comments on Search results breakdown by type