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
Continue reading Using the relevanssi_hits_filter hook

Using the relevanssi_hits_filter hook

One of the most useful filter hooks in Relevanssi is the relevanssi_hits_filter, which lets you modify the array of posts Relevanssi finds. The filter passes an array, where index 0 gives the list of hits in the form of an array of post objects and index 1 has the search query as a string, in…

Read more Using the relevanssi_hits_filter hook 10 Comments on Using the relevanssi_hits_filter hook
Continue reading Using the relevanssi_where hook

Using the relevanssi_where hook

If you want to add extra filters to the search results, you can add them using a hook. Relevanssi searches for results in the _relevanssi table, where terms and post_ids are listed. The various filtering methods work by listing either allowed or forbidden post ids in the query WHERE clause. Using the relevanssi_where hook you can…

Read more Using the relevanssi_where hook 27 Comments on Using the relevanssi_where hook