bostboy — 2011-06-26T14:30:19-04:00 — #1
Is there a way to set an index on words in a varchar field? Or do I just have to use a like query which I would think would be slow over a large file.
To be clear, if I have a title field and the title is How to Cook Spaghetti and Meatballs, I would like it to index on Spaghetti, Meatballs, Cook, etc.
ibazz — 2011-06-26T18:34:19-04:00 — #2
Well the way I do it is to process the input in my server-side language. I take the string "How to Cook Spaghetti and Meatballs", in this scenario and split it into constituent parts, which I then enter to a new table called something like 'meta tags' or 'search tags'.
I store the filename or the parameters necessary for my page to display that content as well as the tags and I also store a description. That way, if someone gets more than one value for a search term, there is a descriptio that will give a bit more detail - just like when search mySQL docs or a search engine.
I can't say for sure that the db table structure is correct but it seems to work for what I am doing.
bostboy — 2011-06-26T18:39:48-04:00 — #3
Thanks, I was keeping that as a backup and was hoping there was some "secret" index method in MySQL that would index the words something like a full text index but for regular varchar fields. Thanks for the input, I appreciate it.