WPSolr not replacing WP_Query

  • cbarwin
    1 year, 7 months ago #29205

    I’ve embedded a basic search form on standard WordPress page (not a WooCommerce shop page, category page, etc.).

    I’m initiating the query below on document load via AJAX. WPSolr is not replacing the query. The search is taking several minutes to complete.

    You can see an example here:

    $args = array(
    ‘meta_query’ => array(
    ‘key’ => ‘_sku’,
    ‘value’ => ‘k2214’,
    ‘compare’ => ‘LIKE’
    ‘post_type’ => ‘product_variation’,
    ‘posts_per_page’ => -1,

    $query = new WP_Query( $args );

    If I enable WooCommerce on the page, it fails with the error below.

    Here’s a duplicate page with WooCommerce enabled:

    component: “Plugin: woocommerce”
    file: “wp-includes/class-wp-query.php”
    key: “60b199856825376f07d8c6ebb8be9106”
    line: 4046
    message: “Trying to get property ‘post_title’ of non-object”
    stack: Array(10)
    0: “WP_Query->is_page()”
    1: “is_page()”
    2: “is_shop()”
    3: “wpsolr\\p\\e\\w\\WPSOLR_Plugin_WooCommerce->is_product_category_url()”
    4: “wpsolr\\p\\e\\w\\WPSOLR_Plugin_WooCommerce->get_is_category_search()”
    5: “wpsolr\\p\\e\\w\\WPSOLR_Plugin_WooCommerce->wpsolr_filter_is_replace_by_wpsolr_query()”
    6: “apply_filters(‘wpsolr_filter_is_replace_by_wpsolr_query’)”
    7: “wpsolr\\c\\c\\s\\WPSOLR_Service_Container::get_is_replace_by_wpsolr_query()”
    8: “wpsolr\\c\\c\\s\\WPSOLR_Service_Container::action_wp_loaded()”
    9: “do_action(‘wp_loaded’)”

    1 year, 7 months ago #29206

    WPSOLR only replaces WordPress archive page queries: search, taxonomies, post types …

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.