Page 1 of 1

Search is Case Sensitive - How can I change that?

Posted: Sun May 21, 2023 5:18 pm
by haywardgg
I've noticed that the Search plugin only returns Case Sensitive results. So if I have a title "Ebook for WordPress" and I search "ebook" or "wordpress" it doesn't return that title/post. Is there any way to change this so that the search is not case sensitive?

Thank you.

Re: Search is Case Sensitive - How can I change that?

Posted: Tue Jun 06, 2023 1:21 pm
by haywardgg
Never mind, i fixed it myself. There's a lot of stuff with Bludit that just feels unfinished and forgotten. At this rate I'll end up going back to WordPress. Just feels abandoned imho! :(

In the search plugin I replaced the search function with this (in case anyone else is looking for a fix to the case sensitive search. There are other issues with search, like returning results that don't even contain the search word or phrase etc.. but someone can maybe help fix those)

Code: Select all

private function search($text)
{
    // Read the cache file
    $json = file_get_contents($this->cacheFile());
    $cache = json_decode($json, true);

    // Convert search text to lowercase
    $text = strtolower($text);

    // Convert cache data to lowercase
    $cache = array_map('array_change_key_case', $cache);

    // Include Fuzz algorithm
    require_once($this->phpPath().'vendors/fuzz.php');
    $fuzz = new Fuzz($cache, 10, 1, true);
    $results = $fuzz->search($text, $this->getValue('minChars'));

    return array_keys($results);
}

Re: Search is Case Sensitive - How can I change that?

Posted: Tue Jun 06, 2023 6:12 pm
by multicolordev
Oh boy, when you want use Bludit and want ready tools from first step you have right, back to wordpress. This still small community if you want compare with wordpress, when you can't stay with unfixed solution week or two, we can't do nothing. Thanks for sharing by the way.

Re: Search is Case Sensitive - How can I change that?

Posted: Wed Jun 07, 2023 9:09 am
by haywardgg
multicolordev wrote: Tue Jun 06, 2023 6:12 pm Oh boy, when you want use Bludit and want ready tools from first step you have right, back to wordpress. This still small community if you want compare with wordpress, when you can't stay with unfixed solution week or two, we can't do nothing. Thanks for sharing by the way.
Some fixes haven't been made in years, so where's the week or two you speak of?

I was also a patron, so I'm entitled to give feedback.

There hasn't been a proper update in years. That's more than a week or two!