Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPSolr free

    (@wpsolr)

    Yes, see

    https://cwiki.apache.org/confluence/display/solr/RequestHandlers+and+SearchComponents+in+SolrConfig

    with

    <lst name=”appends”>
    <str name=”fq”>categories_str:my_category</str>
    </lst>

    Thread Starter bradlol

    (@bradlol)

    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 free

    (@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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filtering post by category’ is closed to new replies.