|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
FULLTEXT search and 3-character words
Hello,
I would like to know what would you do if you're using Mysql FULLTEXT search for 3 character words? Is there a way? If no way, then what are the alternative methods do you use? Thanks, John |
|
#2
|
|||
|
|||
|
Hi John,
You've really only got two options. Firstly, if you have access to the mysql source and can recompile it, follow the instructions at http://docsrv.caldera.com:8457/cgi-...2520Fine-tuning to build a version of mySQL that indexes whatever length words you want. Your only other option is to manually build an index for those three letter words you're interested in. You'll need to create another table with two fields, one to contain the primary of the record you're indexing in, and the other to contain the keywords. You can then use mySQL's regular text matching to match the keywords and incorporate them into your search results. HTH, Hadley |
|
#3
|
|||
|
|||
|
Hadley,
How could you do option #2? Thanks, Corbb |
|
#4
|
|||
|
|||
|
Hi Corbb,
It's probably easiest just to show you: Assumes you have a database called keywords, with a column for the keyword and the primary key of the thing (eg. article) it's identified with. Code is (very) rough, but you should get the general idea. PHP Code:
You can then search this table using exact string matching (which should be reasonably fast provided you've indexed the keyword column) to find the ids of your articles. Hadley |
|
#5
|
|||
|
|||
|
Hadley,
Ah, ok. Thanks! |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > FULLTEXT search and 3-character words |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|