Hi Mikko,
Would it be possible to add a filter to the SQL query inside the relevanssi_didyoumean() function? I'd like to tweak the query via my plugin without having to modify the Relevanssi plugin.
For example, this would be great:
$sql = apply_filters( 'relevanssi_didyoumean_query', "SELECT query, count(query) as c, AVG(hits) as a
FROM $log_table WHERE hits > 1 GROUP BY query ORDER BY count(query) DESC", $query );
$data = $wpdb->get_results( $sql );
Cheers!
John
Certainly, I like adding filters whenever I get good ideas of where to add them. Feel free to use this change, it'll become official in the next version.
jefflennan
Member
Posted 2 years ago #
Should the "did you mean" functionality automatically occur if you have logs turned on? I am not getting that feature and cant find where to "turn it on"
Thanks for any guidance.
Jeff
jefflennan
Member
Posted 2 years ago #
Should the "did you mean" functionality automatically occur if you have logs turned on? I am not getting that feature and cant find where to "turn it on"
Thanks for any guidance.
Jeff
No, you need to add a bit of code on your search results page to see the suggestions. Take a look at the plugin FAQ, the instructions are there.