Search is Case Sensitive - How can I change that?

Post Reply
haywardgg
Ssr. Bludit
Posts: 19
Joined: Wed Apr 05, 2023 10:46 pm
Has thanked: 4 times
Been thanked: 1 time

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.
haywardgg
Ssr. Bludit
Posts: 19
Joined: Wed Apr 05, 2023 10:46 pm
Has thanked: 4 times
Been thanked: 1 time

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);
}
Last edited by haywardgg on Wed Jun 07, 2023 9:11 am, edited 1 time in total.
User avatar
multicolordev
Master Bludit
Posts: 137
Joined: Thu May 26, 2022 12:33 pm
Has thanked: 15 times
Been thanked: 91 times

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.
Image
haywardgg
Ssr. Bludit
Posts: 19
Joined: Wed Apr 05, 2023 10:46 pm
Has thanked: 4 times
Been thanked: 1 time

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!
Post Reply