• Resolved iosoft

    (@iosoft)


    Hello,

    I have a site with 15,000 Jobs (custom post type) running with latest version of WordPress and Relevanssi.

    I am facing a strange problem –
    If someone search for “marketing job” or “dtp job” etc. it is showing the jobs properly.
    But if someone just put “job” or any other very common term in the search, the search page fails (500 Error)

    I think these common terms are returning huge results that is causing ‘execution timeout’ or ‘memory overflow’.

    Can you pls have a look and update this awesome plugin?

    Thanks

    P.S. I am using this type of code-block to have a custom search –

    
    $search_query = new WP_Query($args);
    relevanssi_do_query($search_query);
    
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mikko Saari

    (@msaari)

    That’s a performance issue, yes. Do you have the “Throttle searches” setting checked? If not, make sure it’s enabled.

    If you are using the throttle and the default value is not enough, you can set it lower:

    add_filter( 'pre_option_relevanssi_throttle_limit', function( $limit ) { return 400; } );

    Adjust the value (400) lower until it works. But it should help already at the default value of 500.

    Thread Starter iosoft

    (@iosoft)

    Just one more ‘strange’ behavior –
    If Admin is logged in and search, there is no problem in any type of search!
    But when a guest user do the search, it is causing the 500 error!!!

    After putting some echo and die statements, I realized that relevanssi_do_query($search_query); code is unable to complete the execution!

    • This reply was modified 6 years, 4 months ago by iosoft.
    • This reply was modified 6 years, 4 months ago by iosoft.
    Plugin Author Mikko Saari

    (@msaari)

    Did you try the throttle? Does it help?

    Thread Starter iosoft

    (@iosoft)

    throttle = 300 works
    throttle = +310 doesn’t work

    But if Admin is logged in and search, there is no problem in any type of search!

    Thread Starter iosoft

    (@iosoft)

    P.S. Total number of search output = 558

    Thread Starter iosoft

    (@iosoft)

    P.S. I have just this addition code block that is related to Relevanssi –
    https://www.relevanssi.com/knowledge-base/yoast-local-seo-compatibility-issues/

    Plugin Author Mikko Saari

    (@msaari)

    Ok, if throttle at 300 works, use that. 15 000 posts is so much that a heavily used keyword will cause havoc without the throttle, and depending on many things, handling even 500 posts can be too much.

    It’s also not surprise that admin search works better; there’s probably something in the process that is lighter for admins. Since I don’t know anything of what your site is doing with the posts, I can’t tell what that is, but if you’d dig in, you’d find something that is different and that’s why the admin search is faster.

    Thread Starter iosoft

    (@iosoft)

    P.S. I am talking about the Front-end search only.
    Not related to WP-Admin.

    Anyway, thanks for your time ??
    I really appreciate that you gave your time and suggestions.

    Plugin Author Mikko Saari

    (@msaari)

    Yes, I was also talking about front end search only.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘500 Error if a very common keyword is given for search’ is closed to new replies.