douxian6260 2012-09-10 16:29
浏览 42
已采纳

FULL TEXT按标签或文本字段和MySQL搜索方法

I have this MySQL table

id | description | tags         |
1    hi man       tag1;tag2;tag3
2    hi woman     tag0;tag2;tag9

I would like to know which is the best practice to build up a simple search engine? Is possible to have search keywords priority with only MySQL queries or need i somenthing more complex like elasticsearch, lucene, sphinx, etc .. ??

  • 写回答

2条回答 默认 最新

  • dplo59755 2012-09-10 16:35
    关注

    Just separate tags with a space, not with a semi-colon. Then add FULLTEXT indices to your table.

    Geeky resource: http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

    More friendly resource: http://www.artfulcode.net/articles/full-text-searching-mysql/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?