PDA

View Full Version : Bug in forum search with "value"


Oz81
12-02-2009, 09:04 PM
Hi, there seems to be a bug in the search function.
Try to search for "value" - nothing appears. What's the problem? I cannot find the bug myself ...

Oz81
12-04-2009, 07:26 AM
There's a severe bug in vBulletin software but nobody seems to care?

kh99
12-05-2009, 12:56 AM
There's a severe bug in vBulletin software but nobody seems to care?

If you look in the file includes/searchwords.php you will see a long list of words that you can't search for, including "value". I really don't know where that list comes from.

Oz81
12-05-2009, 07:36 AM
Thanks for you help but this doesn't solve the problem as there is no word "value" in that list, please have a look yourself.

So, it's still a bug nobody seems to care about ...
I should've installed another software I'm afraid. The search for something like "value" is very important in our board.

kh99
12-05-2009, 07:50 AM
From includes/searchwords.php $badwords definition:


'using',
'usually',
'v',
'value',
'various',
'very',
'via',


Hmm...

Oz81
12-05-2009, 07:52 AM
Well, I'm using the German version of this file and it looks like:

'v',
'viel',
'viele',
'vielen',
'vielleicht',
'vllt',
'v?llig',
'vom',
'von',
'vor',
'vorallem',
'vorbei',
'vorher',
'vorstellen',

kh99
12-05-2009, 08:01 AM
Edit: OK, then I guess the problem is somewhere else. Maybe you should report a problem at vbulletin.com.

Oz81
12-05-2009, 08:04 AM
You can go to http://www.wettforum.info/sportwetten/search.php and search for "value". No matches, "values" works though.

But there are posts with "value", tons of, e. g.:
http://www.wettforum.info/sportwetten/anfaengerforum/29639-erste-erfahrungen-und-fragen-3.html#post874487

The search index is up-to-date, too. It just makes no sense ...

kh99
12-05-2009, 08:13 AM
Well, I believe that the search is done using mysql features. I think I've figured out where that list comes from: http://dev.mysql.com/doc/refman/5.4/en/fulltext-stopwords.html

So maybe there some fix in the mysql manual somewhere.

Oz81
12-05-2009, 08:14 AM
Sorry, I had no idea that there was a bad word like "value" in the English file. If you ask me personally, it doesn't really make sense either.
I can understand the prohibition of "very", of course. But why shouldn't somebody search for value. :confused:

Okay, I'll post it there, thanks again for your time.

kh99
12-05-2009, 08:20 AM
From the mysql manual:

The default stopword list is given in Section 11.8.4, “Full-Text Stopwords”. The default minimum word length and stopword list can be changed as described in Section 11.8.6, “Fine-Tuning MySQL Full-Text Search”.

So maybe a fix can be found on this page: http://dev.mysql.com/doc/refman/5.4/en/fulltext-fine-tuning.html

I agree that it's strange that "value" is on that list of words.

Oz81
12-05-2009, 08:30 AM
Thanks, you're a genius, indeed! This must be the source for the mistake but it looks like I would need to recompile MySQL to effectively change the stopwords list!?

I cannot do this on my system, unfortunately, so the mistake stays unsolved. :|
Oh no, I'm wrong maybe it works without, I'll try it later ...

kh99
12-05-2009, 08:35 AM
No, a genius would have posted that back in post #3...:)

Oz81
12-05-2009, 09:07 AM
Damn MySQL, the current version of stopwords is built-in on my system:
ft stopword file (built-in)

So, no chance to change this without recompiling. :|
But at least now we know why it doesn't work ...

Lynne
12-05-2009, 02:07 PM
You don't need to recompile:
After changing the value of this variable or the contents of the stopword file, restart the server and rebuild your FULLTEXT indexes.

Oz81
12-05-2009, 02:14 PM
Okay, please tell my how I can change the contents of a built-in stopword file without recompiling.

Lynne
12-05-2009, 02:24 PM
OK, admittedly, I've never done this, but I can read the page that on the mysql site. It says:

To override the default stopword list, set the ft_stopword_file (http://dev.mysql.com/doc/refman/5.4/en/server-system-variables.html#sysvar_ft_stopword_file) system variable. (See Section 5.1.4, “Server System Variables” (http://dev.mysql.com/doc/refman/5.4/en/server-system-variables.html).) The variable value should be the path name of the file containing the stopword list, or the empty string to disable stopword filtering. After changing the value of this variable or the contents of the stopword file, restart the server and rebuild your FULLTEXT indexes.
You can set the variable either while the system is running (I think just SET xxxxx, I can't remember exactly) or in the my.cnf file. Then restart. I don't see where you are seeing anything about recompiling.

kh99
12-05-2009, 02:42 PM
Is it possible that "built-in" means that it's using the default set, and to customize it you are meant to replace "built-in" with the name of a file?

ETA: OK, it looks like to change it you can put this in the my.ini file:

[mysqld]
ft_stopword_file=""


(or put a file name in the quotes if you want to provide an alternate list of words).

I haven't tried to see how it affects searches but it changes what is reported as the value of that variable. I guess the next question is how you go about rebuilding the indexes.

ETA: I tried it on my Windows system at home, maybe it's different on a Linux server.

Oz81
12-05-2009, 03:49 PM
Oh no, I totally misunderstood "built-in", you're right.
I put "ft_stopword_file = ''" into my.cnf and it seems to work though it's not quite easy to rebuild the index on a huge MySQL table.
But I'll manage this somehow later. Thanks a lot for your help, you made my day!

kh99
12-05-2009, 03:59 PM
You probably realize this already, but just as a reminder: if you use an alternate list or no list in MySQL, you might want to change that searchwords.php to reflect it so that users will get the correct message.

In retrospect, probably the reason you were so confused is because if a search word appears in the searchwords.php file, the user will get a message that says "The following words are either very common, too long, or too short and were not included in your search :". But since your vbulletin had a list of German words, you probably never saw that message.

Oz81
12-05-2009, 08:26 PM
But the vB badwords don't represent the MySQL stopwords anyway I guess!? They're just an addition maybe.
For instance, you can search for "und" (German for "and") and get that message, too.

kh99
12-05-2009, 08:37 PM
I'm not sure, but I think what it is, is that the $badwords is to keep from doing the database search on words that won't work (which I guess would just return no result without explanation? Or maybe there would be an answer). Anyway, by the time you're done you'll be the expert.

Oz81
12-05-2009, 08:48 PM
It doesn't seem like because when I search for "value" here in your board, it tells me "Sorry - no matches. Please try some different terms."

This is a confusing answer, anyway!?

kh99
12-05-2009, 09:00 PM
Yes, it's confusing. I hadn't tried it on this board, you're right, you don't get that same message. I was trying it on the board I have access to.

Ah...I'm a little embarrassed to point this out after all this, but I'm not connected with this board in any way except being a member like you. I'm learning vbulletin myself and have some spare time here and there so I learn more by figuring out other people's problems. For instance, I now know something about how searching works, and I wouldn't if you hadn't asked your question. Sorry if you thought you were getting expert help (although Lynne does belong to this board and is an expert).

ETA: In my defense, it didn't look like anyone else was rushing to answer.

Oz81
12-06-2009, 02:48 AM
But where's the problem? You and Lynne solved the problem perfectly!

kh99
12-06-2009, 01:48 PM
No problem for me, you said "your board" so I just wanted to set the record straight.

Lynne
12-06-2009, 02:03 PM
Hey kh99, I just wanted to add that I'm no expert either (especially when it comes to mysql!). Everyone here appreciates it when users help users - that is what this site is all about.

I'm learning vbulletin myself and have some spare time here and there so I learn more by figuring out other people's problems.
That's exactly why I started helping here and why I continue to help here. :)