Skip to main contentSkip to footer

If Relevanssi Premium causes out-of-memory problems, make sure you have the “Throttle searches” option checked.

However, if that doesn’t work and you’re still getting out of memory issues, you can try making the throttle tighter. The limit can be adjusted by adding this line to your site:

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

If necessary, you can adjust the value (250) to a lower number. Anything over 100 should be safe.

Throttle and termless searches

The throttle is always on when there’s no search term involved in the search. Otherwise, the search would return all posts on the site as a result. That’s too much. If you, for some reason, want to disable the throttle completely in all cases, you can use this line:

remove_filter( 'relevanssi_query_filter', 'relevanssi_limit_filter' );

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

CM Tooltip Glossary
A Relevanssi Premium customer bumped into a weird problem with CM Tooltip Glossary (and probably Elementor). Using Elementor, CM Tooltip…
10Web Photo Gallery
The Photo Gallery plugin from 10Web uses a shortcode to add photo galleries to posts and pages. By default, Relevanssi…

Related Posts:

Comment Section:

7 Comments. Leave new

  • Simon Browning
    December 3, 2021 7:29 am

    For what its worth, this is our index state:

    10670 documents in the index.
    0 users in the index.
    0 taxonomy terms in the index.

    613260 terms in the index.
    2 is the lowest post ID indexed.

    Reply
  • Simon Browning
    December 3, 2021 12:53 am

    Hey there.

    We’re running out of memory when searching.

    I tried:
    add_filter( ‘pre_option_relevanssi_throttle_limit’, function( $limit ) { return 250; } );

    but that gives me:

    Parse error: syntax error, unexpected ‘250’ (T_LNUMBER) in /home/otsnew/public_html/wp-content/themes/Divi-child/functions.php on line 3

    Does this line need to be revised?

    Thank kyou

    Simon

    Reply
    • It’s correct. Make sure all spaces in there are spaces and not shift-spaces.

      Reply
      • Simon Browning
        December 3, 2021 3:30 pm

        Thank you for that.

        I disabled Relevanssi and found that yes, we still have the issue with searches.

        I tracked the issue down to ocurring when we have Ultimate Member enabled. We have member only content on the site, are there any known issues or conflicts with searches and Ultimate Member (I realize its not a Relevanssi issue now, just wondering if it has come up before).

        Simon

        Reply
      • Simon Browning
        December 3, 2021 7:26 am

        Thanks, that fixed it. I went through deleting and recreating the spaces. Strange though, I used the copy function on the web page.

        Still running out of memory though. I even set the throttle down to 10. Is there anything else it could be?

        Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /home/otsnew/public_html/wp-includes/post.php on line 2516

        Reply
        • (There was a shift-space in the sample code. I’ve removed it now.)

          Relevanssi in general isn’t very memory intensive. Even on a larger site, the Relevanssi search memory requirements are measured in tens of megabytes. If you’re running out of a gigabyte of memory, there are some larger issues on your site. I’d investigate what is taking up all that memory. It’s not Relevanssi.

          One thing you can do in Relevanssi is to disable custom excerpts if you’re using them.

          Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed