开发者

What is the best search Algorithm for PHP & MYSQL? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one p开发者_StackOverflow中文版roblem only by editing this post.

Closed 7 years ago.

Improve this question

I want to make a search for articles on my website - is it ok to use just plain 'LIKE' statement or is there a better search algorithm to use with MySQL? (its important it be efficient)


You should look into using Full-Text Search.
It might also help you to read about the Tradeoffs of MySQL LIKE vs Full-Text


is it ok to use just plain 'LIKE' statement or is there a better search algorithm to use with MySQL? (its important it be efficient)

Like

If it is important to be efficient then I think LIKE is absolutely not the way to go.

Full Text Search: 392 Sec Full Text Search (Cached): 272 Sec

Full Text Boolean Mode 12 Sec Full Text Boolean (Cached) 11 Sec

Mnogosearch (external) 3.5 Sec Mnogosearch (external cached) 1.06 Sec

Sphinx 0.23 Sec Sphinx Cached 0.15 Sec

LIKE %...% 30sec Sec LIKE %...% (Cached) 29sec Sec

Sphinx

Probably Sphinx is the most efficient method, which also has support for MySQL. To be honest I have never used Sphinx myself, but some very big sites use it.

What is the best search Algorithm for PHP & MYSQL? [closed]

It is probably more difficult to setup then another(probably last) alternative.

MySQL full-text search

I also think MySQL full-text-search would probably be fast enough and a easier to use.


I would consider Using Apache Solr https://lucene.apache.org/solr/ or Elastic Search http://www.elasticsearch.org/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜