Slow keyword search

  • sraggio
    Participant
    1 year ago #33070

    We have approx 100K products (classical music CDs) in Woocommerce, and when using pre-defined category searches like genre or label, results appear in one or two seconds. However, when searching text (e.g., “beethoven”) it takes approx 18 seconds for results to appear.

    We’re currently using a localhost Apache Solr index, and have also created a new Elastic Search index to see if that would offer better performance, but the results are the same. Any idea why this is happening, and what we can do to improve search times?

    wpsolr
    Keymaster
    1 year ago #33071

    It looks like WPSOLR is not powering the search.

    Did you activate the search archive in screen 2.1?

    You can use Query monitor to verify.

    sraggio
    Participant
    1 year ago #33072

    Yes, index is selected in 2.1. As noted earlier, originally set to the local Solr index, now set to the new Elastic index.

    I installed the Query Monitor plugin, however I’m unable to activate the WP Solr Query Monitor plugin on my test site, it wants a license number and doesn’t recognize the “test” subdomain.

    wpsolr
    Keymaster
    1 year ago #33073

    Please paste here screenshots of screen 2.1 and 2.2

    Did you configure facets (settings and widget) and can you see them on your search and category pages?

    sraggio
    Participant
    1 year ago #33074

    Yes, we have facets configured, and those work on the site. Checkboxes that take between one and two second to load results. Screenshots of 2.1 and 2.2 are here:
    https://photos.app.goo.gl/5p7eVbF98UpgS5VeA
    https://photos.app.goo.gl/jWCbGAu1uncHLwyX8

    wpsolr
    Keymaster
    1 year ago #33076

    All seems correct.

    The query time should be small, either with Solr or Elasticsearch. Only Query monitor could tell us.

    Can you try with smaller parameter of facet items (1600 => 50) in screen 2.1?

    sraggio
    Participant
    1 year ago #33097

    I changed the “number of values to be displayed by filters” to 50, but there was no change in search time. We’re going to get Query Monitor set up on the live site, and see what that tells us.

    sraggio
    Participant
    1 year ago #33105

    When I try to activate the Query Monitor extension on the live site, it asks me for my license. When I enter I get the following message: “Your subscription’s maximum number of 1 ‘WPSOLR PRO – All packs’ licenses is reached. Please remove some licenses first, or upgrade your subscription to add more licenses.”

    We have an “all packs” license, and are only using the plugin on this one site. Can you let me know what I need to do to activate the Query Monitor extension?

    wpsolr
    Keymaster
    1 year ago #33106

    Deactivate your license, then reactivate it.

    sraggio
    Participant
    1 year ago #33126

    The deactivate button does not work, just bounces me back to the first screen indicating that the license is valid. Any other way to deactivate?

    wpsolr
    Keymaster
    1 year ago #33127

    Refresh the page (F5). I checked, your subscription’s deactivation worked on our license backend.

    wpsolr
    Keymaster
    1 year ago #33128

    You should also try without the other plugins.

    sraggio
    Participant
    1 year ago #33129

    That worked, thanks. Query monitor is logging now, this is what I see for a recent search:
    Timing: 18.0193
    Query: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
    FROM wp_posts
    INNER JOIN wp_postmeta AS wcj_sku
    ON (wp_posts.ID = wcj_sku.post_id)
    WHERE 1=1
    AND ( wp_posts.ID NOT IN (
    SELECT object_id
    FROM wp_term_relationships
    WHERE term_taxonomy_id IN (269027) ) )
    AND (((wp_posts.post_title LIKE ‘%kobow%’)
    OR (wcj_sku.meta_key = ‘_sku’
    AND CAST(wcj_sku.meta_value AS CHAR) LIKE ‘%kobow%’)
    OR (wp_posts.post_excerpt LIKE ‘%kobow%’)
    OR (wp_posts.post_content LIKE ‘%kobow%’)))
    AND ((wp_posts.post_type = ‘product’
    AND (wp_posts.post_status = ‘publish’
    OR wp_posts.post_status = ‘acf-disabled’
    OR wp_posts.post_status = ‘wc-printed’
    OR wp_posts.post_status = ‘private’)))
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_title LIKE ‘%kobow%’ DESC, wp_posts.post_date DESC
    LIMIT 0, 20

    sraggio
    Participant
    1 year ago #33130

    However, looking at the WPSolr section of the Query Monitor, I see 977ms for time and the following query:
    { “options”: { “handler”: “select”, “resultclass”: “Solarium\\QueryType\\Select\\Result\\Result”, “documentclass”: “Solarium\\QueryType\\Select\\Result\\Document”, “query”: “text:(kobow)”, “start”: 0, “rows”: 20, “fields”: “*,score”, “omitheader”: true, “querydefaultoperator”: “AND” }, “query”: “text:(kobow)”, “highlighting”: [ { “name”: “title”, “simpleprefix”: “”, “simplepostfix”: “<\/b>”, “fragsize”: 400 } ], “sorts”: { “_sku_i”: “desc” }, “grouping”: { “fields”: [], “options”: { “resultquerygroupclass”: “Solarium\\Component\\Result\\Grouping\\QueryGroup”, “resultvaluegroupclass”: “Solarium\\Component\\Result\\Grouping\\ValueGroup” } }, “fields”: [ “id”, “PID”, “type”, “meta_type_s”, “title”, “numcomments”, “comments”, “displaydate”, “displaymodified”, “*categories_str”, “author”, “*post_thumbnail_href_str”, “*post_href_str”, “snippet_s” ], “facets”: { “_stock_status_str”: { “type”: “field”, “excludes”: [] }, “product_badges_str”: { “type”: “field”, “excludes”: [] }, “product_cat_str”: { “type”: “field”, “excludes”: [] }, “_regular_price_f”: { “type”: “range”, “excludes”: [] }, “pa_genre_str”: { “type”: “field”, “excludes”: [] }, “pa_record-label_str”: { “type”: “field”, “excludes”: [] } }, “filters”: { “authorized indexed types”: { “query”: “type:(\”product\”)”, “tags”: [ “fct_excl_type” ] }, “bad_statuses”: { “query”: “-post_status_s:(\”draft\” OR \”pending\” OR \”trash\” OR \”future\” OR \”private\” OR \”auto-draft\”)”, “tags”: [] }, “_stock_status_str:instock_stock_status_str”: { “query”: “_stock_status_str:(\”instock\”)”, “tags”: [ “” ] }, “type:producttype”: { “query”: “type:(\”product\”)”, “tags”: [ “” ] }, “woocommerce exclude-from-search visibility”: { “query”: “((-type:(product)) OR ((((*:* -product_visibility_str:*)) OR (-product_visibility_str:(exclude\\-from\\-search)))))”, “tags”: [] }, “front-end exclusion 1”: { “query”: “(*:* -is_excluded_s:[* TO *]) OR is_excluded_s:(n)”, “tags”: [] } } }

    wpsolr
    Keymaster
    1 year ago #33131

    You should not see this SQL query. Where does it come from in the query monitor trace?

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.