• Resolved donnytree

    (@donnytree)


    Hello,

    I noticed that we get a 500 error when searching for something with an apostrophe in it (e.g., Father’s Day), and the resulting query string in the URL is /?s=father%27s. If I change the parameter for fuzzy matching from Always to When straight search gets no hits, then the search with apostrophe works fine.

    Thank you in advance,
    Donna

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

    (@msaari)

    Do you have access to server PHP error logs? 500 error doesn’t really tell anything of what’s happening, but the error logs might give a clue of what’s actually going on.

    Do you get the error immediately, or is there a long delay between the search and the error?

    Thread Starter donnytree

    (@donnytree)

    Hi Mikko,

    I am looking at the error logs and I don’t see anything. The error occurs immediately.

    Thanks!
    Donna

    Thread Starter donnytree

    (@donnytree)

    Hi Mikko,

    I asked our hosting provider to look for any errors and she said this stood out:
    [Mon Jun 12 09:10:40 2017] [error] [client] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 81 bytes) in /wp-includes/wp-db.php on line 1846

    Not sure if that helps?

    Thanks!
    Donna

    Plugin Author Mikko Saari

    (@msaari)

    How big is your Relevanssi index? How many posts in the “State of the index”? Do you have “Limit searches” enabled?

    Thread Starter donnytree

    (@donnytree)

    Hi Mikko,

    Documents in the index: 1914
    Terms in the index: 577884
    Highest post ID indexed: 54132

    No we do not have Limit searches enabled, we are using the sort by date feature and a lot of articles were missing from results if we did this.

    Thank you!
    Donna

    Plugin Author Mikko Saari

    (@msaari)

    The problem is caused by the apostrophe. Relevanssi sees “father’s” as “father s”, and with fuzzy matching always enabled, the “s” will find every post in the database, hence blowing out your server memory capacity. That’s why the “Limit searches” setting is there.

    If you can’t use that, then I’d suggest setting the fuzzy search option to something else than “Always”.

    I’ll improve this part of Relevanssi in the next version.

    Thread Starter donnytree

    (@donnytree)

    Hi Mikko,

    Thanks! We would use it if we could set the max limit, but it just defaults to 500. It would be great to have this improved in a future version.

    Thanks again for all and for the awesome plugin,
    Donna

    Plugin Author Mikko Saari

    (@msaari)

    You can set the limit; the setting field to do that has just been hidden, because many people used it to break their searches.

    The number is stored in relevanssi_throttle_limit, so to adjust it, just add update_option('relevanssi_throttle_limit', 'X'); somewhere that gets run and adjust X to whatever works.

    However, if you’re ordering by date, the throttle does order by posts by relevancy to keep the most relevant results, so it may well end up cutting more recent results. However, that’s another thing I may be able to improve in future versions.

    Thread Starter donnytree

    (@donnytree)

    Hi Mikko,

    Awesome, thanks so much! We are ordering by date right now because when we choose relevance the newer articles get buried, even if they are just as relevant to/match the search term(s).

    Thank you again for all, really appreciate it,
    Donna

    Plugin Author Mikko Saari

    (@msaari)

    A quick tip here: Relevanssi Premium has a “date boost” feature, which lets you give a boost to the recent articles. You can adjust the cut-off date and the amount of the boost.

    Thread Starter donnytree

    (@donnytree)

    Awesome, thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘500 error with apostrophe and fuzzy matching’ is closed to new replies.