News:

Wondering if this will always be free?  See why free is better.

Main Menu

Minimum search length

Started by bitmovel, October 01, 2008, 04:20:44 AM

Previous topic - Next topic

bitmovel

Hi

How can I set Minimum search length to 1 character?

Best Regards

bitmovel

Quote from: bitmovel on October 01, 2008, 04:20:44 AM
Hi

How can I set Minimum search length to 1 character?

Best Regards


thank you for all the replies. :)

here is the solution, on Sources/Search.php

/* elseif (strlen($value) < 2)
{
$context['search_errors']['search_string_small_words'] = true;
unset($searchArray[$index]);
}*/

H

I have to wonder what your reason for doing this is :). I can't see it being good for search performance either.

Anyone else who wants to did this will also need to make sure that they either don't use the fulltext search option or that the fulltext minimum character setting in MySQL is also set to 1.
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

bitmovel

I have a movie related forum

a search example was:

'how i met your mother'

the search returned a error, since it could not search the word 'I'

This had to be done ;)

H

Which search method are you using? :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

bitmovel

at the moment I am using Fulltext index in SMF 2.0 b3

this worked for me. should I have done something else?


Rumbaar

Yeah just search for "how met your mother", it will ignore the single characters and return the same results as well.  Also reduce load on the server for finding each and every 'i' in a post.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: