Rails 中的 MySQL 全文搜索?
当我向我的第一个 Rails 应用程序添加搜索功能时,我使用了 Sphinx,因为我了解到使用 MySQL 的内置全文搜索是一个坏主意。虽然 Sphinx 运行良好,但设置起来有点复杂,而且我觉得我的应用程序中所需的简单搜索功能负担过重。
我的网站上执行的搜索并不频繁(最多每 3-4 秒一次搜索),因此我不太担心负载。
我的问题:与 Sphinx/Ferret/Solr/etc 相比,为什么使用 MySQL 的全文搜索是一个坏主意?
When I added search functionality to my first Rails app, I used Sphinx, after reading that using MySQL's built-in fulltext search was a bad idea. While Sphinx works well, it's a bit complicated to set up, and I feel there's too much overload for the simple searching functionality I require in my app.
Searches aren't performed very often on my site (at most one search every 3-4 seconds), so I'm not too worried about load.
My question: Why exactly is using MySQL's full text search a bad idea, compared to Sphinx/Ferret/Solr/etc..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MySQL 是一个关系数据库,而不是一个搜索服务器,所以我们现在谈论的是使用不是专门为该任务构建的东西。话虽这么说,MySQL 的全文搜索效果非常好;但是,如果您需要扩展,那就不好了。
但是,YMMV 并且如果您的应用程序能够承受 MyISAM 的缺点,请务必使用它。只需知道它并不是适合大多数任务(不是全部,但大多数)的出色生产引擎。
MySQL is a relational database and not a search server so right off, we are talking about using something that wasn't built specifically for the task. That being said, MySQL's full text search works pretty well; however, it isn't good if you need to scale.
But, YMMV and if your application can survive being subjected to MyISAM's shortcomings, by all means, use it. Just know that it is not a great production engine for MOST tasks (not ALL, but most).