Hi haven't had yet the time to try the relevansi_hits_filter, but in the meantime i've tought about another question:
Is possible to get the terms (not filtering the results with terms) and place them in a variable that then i can send to another plugin (In my case Query multiple taxonomies = QMT)?
At the moment, on search.php page, inside the loop, i've placed some variables defined with
$term_list_taxonomy1 = wp_get_post_terms($post->ID, 'taxonomy1', array("fields" => "all"));
$term_list_taxonomy2 = wp_get_post_terms($post->ID, 'taxonomy2', array("fields" => "all"));
//And so on..
and then getting the slug terms with
In this way i can build a query string suitable for QMT:
I successfully obtained the QMT suitable string, that placed in an html anchor tag will work when clicked, it updates the QMT lists in the sidebar.
What i need now is to send this string, as variable, to the QMT plugin before QMT starts.
As it is now, i can create the variable $qmt_string containing the complete string, but it is created inside the search.php template page loop.
Instead, i have to create it before QMT fires, as it will be required from QMT when a search is performed.
The flow is the following:
-I put a keyword into the searchform.
-I click the search button.
-In this moment i do both the search and the $qmt_string variable creation placing into it the QMT suitable string.
-The $qmt_string variable will be filled and ready to be read from the QMT plugin.
-Search.php template wiull show the search results and the QMT lists on the sidebar updated with the string that i sent to QMT, $qmt_string.
What i've noticed is that anything i put at the start of the functions.php will be processed before QMT.
So, i assume that if i can make use of some relevanssi function inside the functions.php, that can create the $qmt_string before it's loaded QMT, and before the results are displayed on the search.php template, i could achieve my goal.
But i don't know if this is possible using relevanssi Outside of search pages or using the relevansi_do_query function.
Or using another different solution...don't know..