Relevanssi can’t be used in any situation, because it checks the presence of search with the
is_search() function. This causes some unfortunate limitations and reduces the general usability of the plugin.
You can, however, access the query engine directly. There’s a function called
relevanssi_do_query(), which can be used to do search queries just about anywhere. The function takes a WP_Query object as a parameter, so you need to store all the search parameters in the object (for example, put the search terms in
$your_query_object->query_vars['s']). Then just pass the WP_Query object to Relevanssi with
Relevanssi will process the query and insert the found posts as
$your_query_object->posts. The query object is passed as reference and modified directly, so there’s no return value. The posts array will contain all results that are found.