|How to find related items in a no so similar list?|
queries, match, mysql
| 4:41 am on Apr 30, 2010 (gmt 0)|
I have a question about searching in MySQL:
I have a table with 1.5+ million records in only one field plus the auto increment field. The records might seem similar some times, but some others they are not what kind of query I can run to try to find similar items?
Note: I was thinking about LIKE queries or FULL TEXT, but after testing them I found out they are not good.
| 6:29 pm on Apr 30, 2010 (gmt 0)|
|what kind of query I can run to try to find similar items? |
What aspects of the records make them "similar?"
Items that are the same color, size, or other attributes?
Some part of the actual record that is similar?
Mnemonic similarities, like "here" and "hear" or "to","two," and "too"? (I've always wished for a project in which I could use soundex(). :-)
| 6:34 pm on Apr 30, 2010 (gmt 0)|
Can you post some examples of what makes the data "similar" to others?
What made them "not good?"
|I was thinking about LIKE queries or FULL TEXT, but after testing them I found out they are not good. |
| 2:13 pm on Jun 13, 2010 (gmt 0)|
Sorry for the long delay here is a sample:
I have been thinking in using PHP to cut the strings and get i.e. the first 3 letters or the last 3 and then run the query.
| 5:02 pm on Jun 13, 2010 (gmt 0)|
Well, the following would work:
WHERE MyField LIKE 'FIP%'
As long as you have an index on MyField, it should run pretty quickly.
If not, then you probably have other more serious problems and you should do further investigation into what's going on with your server (especially if it is shared with other users).