• I am using Relevanssi along with FacetWP (using FacetWP – Relevanssi integration). It works fine for some keywords. But for some other keywords, it’s throwing 502 Bad Gateway Nginx Error.

    The server admin informed us that something is going in a loop for around thousand times before killing the process. Here is what happens in the loop.

    05:56:29.337587 open(“/var/www/vhosts/ahlihukum.com/httpdocs/wp-content/themes/listable/job_manager/job-filters.php”, O_RDONLY) = 7
    05:56:29.339087 open(“/var/www/vhosts/ahlihukum.com/httpdocs/wp-content/themes/listable/job_manager/job-listings-start.php”, O_RDONLY) = 7
    05:56:29.340283 sendto(5, “\241\0\0\0\3SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘job_listing’ AND ((wp_posts.post_status = ‘publish’)) ORDER BY wp_posts.post_date ASC “, 165, MSG_DONTWAIT, NULL, 0) = 165
    05:56:29.349480 sendto(5, “U\2\0\0\3SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag 0.75 + relevanssi.link 0 + relevanssi.author + relevanssi.category 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf\n\t\t\t\t\t FROM wp_relevanssi AS relevanssi WHERE relevanssi.term = ‘erwin’ AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM wp_posts AS posts\n\t\t\t\tWHERE posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘job_listing’, ‘product’, ‘dwqa-question’, ‘dwqa-answer’))) OR (doc = -1)) ORDER BY tf DESC LIMIT 500”, 601, MSG_DONTWAIT, NULL, 0) = 601
    05:56:29.350031 sendto(5, “Q\0\0\0\3SELECT FROM wp_posts WHERE id IN (11297,13824,11850,12917,12,11138,11139,1439)”, 85, MSG_DONTWAIT, NULL, 0) = 85
    05:56:29.350761 sendto(5, “=\1\0\0\3SELECT COUNT(DISTINCT(relevanssi.doc)) FROM wp_relevanssi AS relevanssi WHERE relevanssi.term = ‘erwin’ AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM wp_posts AS posts\n\t\t\t\tWHERE posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘job_listing’, ‘product’, ‘dwqa-question’, ‘dwqa-answer’))) OR (doc = -1))”, 321, MSG_DONTWAIT, NULL, 0) = 321

    Could you please suggest possible reasons for this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    How many posts that search matches? Sounds like the search may be too heavy for the server. Try enabling the “Limit searches” setting, or adjusting it to a lower value – perhaps 200 or so. Does that help?

    If it doesn’t, then you’re probably better off with an external search, like AddSearch or Swiftype, that doesn’t tax your server but instead runs on an external server.

    Thread Starter Debiprasad Sahoo

    (@debiprasad)

    Did you notice something in this query:

    SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag 0.75 + relevanssi.link 0 + relevanssi.author + relevanssi.category 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf\n\t\t\t\t\t FROM wp_relevanssi AS relevanssi WHERE relevanssi.term = ‘erwin’ AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM wp_posts AS posts\n\t\t\t\tWHERE posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘job_listing’, ‘product’, ‘dwqa-question’, ‘dwqa-answer’))) OR (doc = -1)) ORDER BY tf DESC LIMIT 500

    “relevanssi.tag 0.75”: I think it’s missing an operator here. Is it a bug?

    Plugin Author Mikko Saari

    (@msaari)

    Yes, there’s an asterisk missing from couple of places; how’s that possible, I don’t know, because it definitely exists in the source code. Might be just how the error message prints out?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘502 Bad Gateway Nginx Error for some keywords’ is closed to new replies.