• Any chance of getting Relevanssi support for the plugin?

    It’d be fairly simple. In the ajax_response() function, just pass the query to Relevanssi:

    $query = new WP_Query( $query_args );
    if ( function_exists( 'relevanssi_do_query' ) ) {
        relevanssi_do_query( $query );
    }

    That’s it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Konstantin Obenland

    (@obenland)

    Hi Mikko,

    Thanks for reaching out!

    You can add support for Relevanssi by filtering 'wpss_search_results' (Reference). The filter receives the query object as the second parameter and you can then just return the updated array of post titles.

    Rather than doing another search query after the original query has run, have you considered filtering WP_Query instead?

    Thanks,
    Konstantin

    Thread Starter Mikko Saari

    (@msaari)

    In usual use, Relevanssi does filter the WP_Query, preventing the default query, and here it would also be best to skip running WP_Query, and just create the WP_Query object without running the query and then pass that object to relevanssi_do_query(). This just was the easiest solution.

    But I’ll add a filter in Relevanssi to add compatibility, that way my users don’t have to worry about this and it’ll just work. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Relevanssi support’ is closed to new replies.