Topic awaiting preservation: MySQL search engine. |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
posted 02-23-2004 21:58
I'm trying to write a php search engine for a small table. This is the main part of my code: code: function performSearch($string){
|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 02-23-2004 23:53
I believe that there is a rule where your search string can not appear in more than 50% of your query space. This means that you should query at least 3 rows, with each row containing different data, that way you will not have a 50% problem. I am told that this is good for larger databases, where you could spend a lot of overhead searching for each instance of 'a' in the text. You also didn't state how you constructed your table. You must specify fulltext(title,body) in your table creation or you must alter your table so that those two rows are both in the fulltext realm of control. If you specify them on their own it will not search correctly. You should also make sure that your seach string does not contain any of the stop values, such as -,~ or + I think there may be some others, that can cause funky behavior. |
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
posted 02-24-2004 00:43
I used the ALTER statment after I made the table, because I had never even heard of fulltext searching when I got started. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 02-24-2004 01:48
norm: I looked itno this a while back and if you look at the online manual: |
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
posted 02-24-2004 02:24
Emps: |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 02-24-2004 17:36
hm. turn on error reporting norm. Error_reporting(E_ALL) - no see how fine your arrays without the quotes actually are. (PHP defaults undefined constanst to their string value. But that's not well defined behaviour, and more or less just an accident of the current implementation. So I for one would not rely on it). |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 02-24-2004 20:02
Half a second is a really long time in computer terms. The problem with that is that is 2 simultaneous queries take a second, and then 4 takes two seconds, and 8 takes four second, and so on, eventually that adds up to some real time, or real issues. |