Best way to build a SMART mySQL & PHP search engine?

后端 未结 5 2029
梦如初夏
梦如初夏 2020-12-25 08:09

What is the best way to build a mySQL & PHP search?

I am currently using things like

%term%

I want it to be able to

5条回答
  •  悲&欢浪女
    2020-12-25 08:48

    like '%term%' is terrible slow and unoptimized , you might want to add full-text for this column, and use boolean mode for this

    Such as

    match(column) against('+One +Shop +Stop' in boolean mode)
    

    Take note on the min word lengths is 4, so, you need to consider change it to three, and full-text search only available for myisam

    Other opensource search engine like sphinx is ideal for this too

提交回复
热议问题