internal Search function with Wildcards enabled

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
huedlrick

internal Search function with Wildcards enabled

Post by huedlrick »

i wanted to be able to search with wildcards so i changed just two things in 'action.dosearch.php'
i have marked them red. it will now find every word that start with the entered value in the searchfield.
an example: you enter 'Foot' and you will find every word that starts with 'foot' like football, .....

        if ($nb_words > 0)
        {
                #$searchphrase = implode(' OR ', array_fill(0, $nb_words, 'word = ?'));
                $ary = array();
                foreach ($words as $word)
                {
                        $word = trim($word) . "%";
                        $ary[] = "word LIKE " . $db->qstr(htmlentities($word, ENT_COMPAT, 'UTF-8'));
                }
                $searchphrase = implode(' OR ', $ary);

i think that is an useful change for future versions
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: internal Search function with Wildcards enabled

Post by tsw »

nice, I think it needs a setting "use_wildcards" or something

wanna add a FR in forge so this doesnt get lost in the forum

thanks
Locked

Return to “Modules/Add-Ons”