...

View Full Version : fulltext index



yebaws
03-24-2009, 04:56 PM
I've come up against another problem using searches of fulltext indexes and hope somebody can offer me a bit of advice....

One column has a CSV list of 2, 3 & 4 character initials - for example: "BL, BT, GL, IWM, NMM, NRA, TNA,". I want to be able to search for rows that contain ANY particular initials.

For example, I can build a string "BL, GL, TNA" with check boxes to search for all rows containing any of those initials. But mysql only indexes words of 4 or more characters by default. I've emailed my ISP to see if they can change the configuration to allow indexing of 2 character words, but I'm guessing that the answer will be "no" as it will probably require a server wide change. So is there a way around this?

Using LIKE won't work because a LIKE search for "BL, BT, GL, IWM, NMM, NRA, TNA," will only return a row that has exactly that string, and not one that just contains BL for example. I'm a bit stumped with this one.....

bazz
03-24-2009, 05:55 PM
post your query so far and we may be able to help.


bazz

guelphdad
03-24-2009, 06:01 PM
Normalize your data instead.

bazz
03-24-2009, 06:08 PM
Oh, I missed that bit where he said


One column has a CSV list of 2, 3 & 4 character initials ....


:o

yebaws
03-24-2009, 07:25 PM
Normalize your data instead.

well, yes, in an ideal world. And I'll do that in the long term. I didn't make the database, so I'm not guilty there. But I need this search up quickly and normalising the data will not be quick. Should have said that to start with, anticipating the responses....

guelphdad
03-24-2009, 08:25 PM
use find_in_set

yebaws
03-24-2009, 08:30 PM
use find_in_set

thank you - that's the one!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum