MyBB Community Forums

Full Version: Search and strlen not working right
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I did a search for "side boxes mod" in the code modifications forum and it said that string isn't long enough.
This isn't a bug. Each of the words you search for must be longer than 4 characters.

("mod" is only 3 characters)
Isn't there a way to overide that...or take that value out of the search?

An option in the Admin CP to enable "deleting" short words from search strings would be ideal...
Or just show a message something like google does.
Quote:"mod” was excluded from the search as is it too short
Yeah, like that, but it shouldn't be an error message that stops the search. It should appear above the results.
I agree. That would be rediculous because we can't use things like "A" or "I" in searches. It should just be ignored
Thinking about it, i suppose its done to stop you wasting a search and having to wait for the search flood to run out before you can try and search again with longer terms.

Still i believe ignoring and highlighting invalid terms would be less irritating in the long run.
Well I've suggested it on the Beta forums, but I don't expect it will appear until 1.4, or if someone creates a mod..
I am not completely sure if MyBB relies on Full-Text searching of MySQL, but if it doesn't already, I would recommend to use that or else search would be really slow on boards with good amount of posts. Well, mysql's default minimum word length for fulltext searches is 4 characters.

Edit: OK, it seems like MyBB 1.2 uses fulltext searching while the older version relied on a resource extensive way of searching. You can increase configure mysql to allow shorter word searches but that's gonna be a variable tuning which only hosts can do.
We usually can't configure MySQL to allow for search terms shorter than 4 characters. We can, however, just filter these words out - which might be a good idea.