Support » Plugin: Relevanssi - A Better Search » Relevanssi with WP Event Manager

  • Resolved dustyyy

    (@dustyyy)


    I noticed someone else having a similar issue and I spent hours trying to figure out a solution. I thought I’d share the filter in case someone else runs into the same issue. This is a filter that gets called after the search query for WP Event Manager. Without it, search results return empty when Relevanssi is enabled.

    add_filter('get_event_listings_result_args', function($result) {
    	relevanssi_do_query($result);
    
    	return $result;
    });

    I submitted this to the WP Event Manager team, so hopefully it gets added to their core.

    Hope it helps.

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

    (@msaari)

    Thanks! You may want to check if this performs better:

    add_filter( 'get_event_listings_query_args', function( $args ) {
      $args['relevanssi'] = true;
      return $args;
    } );

    Looks like WP Event Manager caches the results, and the Relevanssi results from get_event_listings_result_args won’t be cached, while the Relevanssi results made this way should be cached. Check with Query Monitor, is there a significant difference in the number of database queries or in the memory use, especially with repeated queries?

    Thread Starter dustyyy

    (@dustyyy)

    Thanks for that! I confirmed that it works, but haven’t done any performance tests. While trying to find the issue I disabled caching on Event Manager and noticed a significant difference, so I imagine your query_args filter can only improve things if it leaves Relevanssi caching intact.

    Thanks again

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.