Slow keyword search
- sraggioParticipant1 year, 11 months 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?
wpsolrKeymaster1 year, 11 months ago #33071It 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.
sraggioParticipant1 year, 11 months ago #33072Yes, 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.
sraggioParticipant1 year, 11 months ago #33074Yes, 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/jWCbGAu1uncHLwyX8sraggioParticipant1 year, 11 months ago #33105When 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?
sraggioParticipant1 year, 11 months ago #33129That 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, 20sraggioParticipant1 year, 11 months ago #33130However, 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”: [] } } }
You must be logged in to reply to this topic.