WordPress.org

Support

Support » Plugins and Hacks » Relevanssi - A Better Search » [Resolved] [Plugin: Relevanssi – A Better Search] Filter on the "Did you mean?" query

[Resolved] [Plugin: Relevanssi – A Better Search] Filter on the "Did you mean?" query

  • 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    @msaari

    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.

    Plugin Author Mikko Saari

    @msaari

    This is now in 2.7.2.

    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

    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

    Plugin Author Mikko Saari

    @msaari

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: Relevanssi – A Better Search] Filter on the "Did you mean?" query’ is closed to new replies.
Skip to toolbar