Search code examples
mysqlsearchfull-text-searchdomain-name

Mysql Search for Domain Names


I have a table full of domain names. I'd like to do a search that returns some kind of relevancy results on it. My problem, is that if I do a search for "cool" I want it to return "cooldomain.com", which a fulltext search, unless I'm doing it wrong, will not.

Are there any fulltext options I'm unaware of that will accomplish this? If not, how would I go about doing it?


Solution

  • I'd use LIKE here, fulltext search is for matching against full words or expressions, query expansion, etc. And I think the * operator can only be used as a suffix when using MATCH, so you'll miss imcool.com...

    I think you'll have to gather more information to make a relevancy sorting.

    Edit: If you want to use an index, you can also store the words of the domain in another column, and use the power of fulltext search on this one...