建立SMART mySQL&的最佳方法PHP搜索引擎? [英] Best way to build a SMART mySQL & PHP search engine?

查看:98
本文介绍了建立SMART mySQL&的最佳方法PHP搜索引擎?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建mySQL&的最佳方法是什么? PHP搜索?

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

我目前正在使用类似的东西

I am currently using things like

%term%

%term%

我希望它能够找到结果,即使他们的拼写略有错误,例如:

I want it to be able to find the result even if they spell it slightly wrong, for example:

字段值=一个:停止销售:

Field value = "One: Stop Shop:

他们搜索:

一站式购物

OR

一站式服务

等等.我想要一个非常聪明的搜索,这样即使他们没有搜索确切的内容,他们也可以找到信息.

Etc.. I want a really smart search so they find the information even if they don't search the exact thing.

构建这样的智能搜索的最佳方法是什么?

What is the best way to build a smart search like this?

推荐答案

like '%term%'非常慢且未经优化,您可能想为此列添加全文,并

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

例如

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

请注意,最小单词长度为4,因此,您需要考虑将其更改为3,并且全文搜索仅适用于myisam

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

其他开源搜索引擎(例如 sphinx )也是理想的选择

Other opensource search engine like sphinx is ideal for this too

这篇关于建立SMART mySQL&的最佳方法PHP搜索引擎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆