Is there any hook where I can change query or do I have to edit your code? Cause I see
// Filter to change the solarium query
do_action( WpSolrFilters::WPSOLR_ACTION_SOLARIUM_QUERY,
array(
WpSolrFilters::WPSOLR_ACTION_SOLARIUM_QUERY__PARAM_SOLARIUM_QUERY => $solarium_query,
WpSolrFilters::WPSOLR_ACTION_SOLARIUM_QUERY__PARAM_SEARCH_TERMS => $wpsolr_query->get_wpsolr_query(),
WpSolrFilters::WPSOLR_ACTION_SOLARIUM_QUERY__PARAM_SEARCH_USER => wp_get_current_user(),
)
);
but it is an action not filter, which as far as I know is not supposed to change anything.
Plugin Author
WPSOLR
(@wpsolr)
If you feel comfortable with Solarium library, you can use this action indeed to add your own categories filter query.
Look for
add_action(WpSolrFilters::WPSOLR_ACTION_SOLARIUM_QUERY
in the code, and you’ll get some examples.