Log in

View Full Version : How do I allow a 3-character search?


gle041
02-17-2009, 07:21 PM
Currently my vBulletin won't let me search for anything 3 characters or less.

How can I allow a 3 character search?

Running vB 3.7.3

Thanks in advanced!

bananalive
02-17-2009, 07:24 PM
AdminCP -> vbulletin options -> Message Searching Options -> Search Index Minimum Word Length

gle041
02-17-2009, 08:22 PM
Thank you, I just did that but now when I search for a 3 character word that I know should have results it says nothing found. Why is this?

Do I have to rebuild something?

Thanks.

dismas
02-17-2009, 08:41 PM
If you go to Maintenance > Update Counters > Rebuild Search Index, I'm pretty sure that will do what you want.

gle041
02-17-2009, 09:37 PM
Just did that, still not coming up with results. In the settings I was told to change in the second post, I noticed it says "MySQL Fulltext has its own minimum word length as well that must be changed at the server level." on the page as well. Is that something I need to do?

snakes1100
02-17-2009, 09:38 PM
AdminCP -> vbulletin options -> Message Searching Options -> Search Index Minimum Word Length

This only applies if your using the vbulletin built in default search.

If your using MySQL FULLTEXT search, you need to apply new settings to my.cnf and restart MySQL.

ft_min_word_len = 3
ft_max_word_len = 25

gle041
02-17-2009, 09:40 PM
Okay, under my search type it says "Your forum is currently using the Fulltext search engine. "

How would I do what you said above?

Thanks a bunch for your help!

snakes1100
02-17-2009, 09:50 PM
ssh into server.

depending on system

RH, CentOS
nano /etc/my.cnf

Debian
nano /etc/mysql/my.cnf

Add those two variables i posted above to the [mysqld] section.

ctrl+x
answer yes
hit return

Then type one of the following, again dependent on system.
service mysql restart
service mysqld restart
/etc/rc.d/init.d/mysql restart
/etc/rc.d/init.d/mysqld restart
/etc/init.d/mysql restart
/etc/init.d/mysqld restart

gle041
02-17-2009, 09:53 PM
I don't think I have access to do that, I'm on a shared hosting plan from LunarPages. Would I need to contact them?

snakes1100
02-17-2009, 09:54 PM
yes you would.

i doubt they will change it for you tho.

gle041
02-17-2009, 09:56 PM
Yikes. Okay, well is there any way I could allow a 3 character search? What about if I use the "built in default search"?

snakes1100
02-17-2009, 09:59 PM
u can switch it back to the vb search and set the limit in the admincp as suggested above by banana.

dismas
02-17-2009, 10:14 PM
If you know that you'll only have a limited number of three letter words that users would search for, you can put them in the "Words to be Included Despite Character Limit" field. That way your board won't index common words such as "the, for, way, you, can, put, not, fix, yes, and" and so on.

Shamil.
02-18-2009, 12:08 AM
If you know that you'll only have a limited number of three letter words that users would search for, you can put them in the "Words to be Included Despite Character Limit" field. That way your board won't index common words such as "the, for, way, you, can, put, not, fix, yes, and" and so on.

Is there some sort of a hack to get round this?

dismas
02-18-2009, 12:55 AM
Is there some sort of a hack to get round this?

What do you mean? If you're using the default vB search, you just have to put the three-letter words that you want added to the search index into the field that I mentioned, "Words to be Included Despite Character Limit".

For instance, I run an automotive/offroad forum, so I have things like O2, ATV, ABS, and fan included in the search database while my minimum character limit is set to 4 characters. So those words are still able to be searched for even though my limit is 4. No hack necessary.