[英]Mysql (fulltext?) search for products
I am building a very simple product catalog that will store products inside mysql table and I want to search products as fast as possible (and as relevant as possible). 我正在构建一个非常简单的产品目录,该产品目录将产品存储在mysql表中,并且我想尽快(且尽可能相关)搜索产品。 The products database will be quite large (about 500.000 products) which is why searches using "like" that are not using indexes are very slow. 产品数据库将非常大(大约50万个产品),这就是为什么不使用索引的使用“顶”的搜索非常慢的原因。
I have many fields but the only ones I want to search are: 我有很多字段,但我要搜索的唯一字段是:
I tried experimenting with fulltext search but there were some problems: 我尝试尝试全文搜索,但是存在一些问题:
What would be the best way to do searches on this table like this? 像这样在此表上进行搜索的最佳方法是什么? The only way that gives results that are good in my case is splitting the query string and querying multiple queries using "like" operator for every string and somehow calculate the weight but this solution works very slow (even more than 15 seconds for a single query which is too slow). 对于我而言,提供良好结果的唯一方法是拆分查询字符串,并使用“ like”运算符为每个字符串查询多个查询,并以某种方式计算权重,但是此解决方案的运行速度非常慢(单个查询甚至超过15秒)太慢了)。
I don't expect everything to be possible using only single query but I am looking for a solution that would be fast and as relevant as possible. 我不希望仅使用单个查询就能实现所有功能,但是我正在寻找一种快速且尽可能相关的解决方案。 If this means building some kind of custom word index or similar I am also willing to do this, I just need an idea how to manage this? 如果这意味着建立某种自定义单词索引或类似的内容,我也愿意这样做,那么我只需要一个如何管理它的想法?
thank you! 谢谢!
我们将搜索迁移到Sphinx。现在,我们需要微调结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.