MySql全文或Sphinx或Lucene还是其他? [英] MySql Full text or Sphinx or Lucene or anything else?

查看:95
本文介绍了MySql全文或Sphinx或Lucene还是其他?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用MySql,并且有一些表需要对它们执行布尔搜索.考虑到我的表是Innodb类型的事实,我发现执行此操作的更好方法之一是使用Sphinx或Lucene.我对使用这些查询有疑问,我的查询格式如下,

I am currently using MySql and have a few tables which i need to perform boolean search on. Given the fact my tables are Innodb type, I found out one of the better ways to do this is to use Sphinx or Lucene. I have a doubt in using these, my queries are of the following format,

Select count(*) as cnt, DATE_FORMAT(CONVERT_TZ(wrdTrk.createdOnGMTDate,'+00:00',:zone),'%Y-%m-%d') as dat from t_twitter_tracking wrdTrk  where  wrdTrk.word like (:word) and   wrdTrk.createdOnGMTDate between :stDate and :endDate group by dat;

查询中有一个日期字段,需要将其转换为登录用户的时区,然后再将其用于分组依据.

the queries have a date field which needs to be converted to the timezone of the logged in user and then the field used to do a group by.

现在,如果我迁移到Sphinx/lucene,我将能够获得与上面的查询类似的结果.我是Sphinx的初学者,我应该使用这两个中的哪个,或者有什么更好的选择.

Now if i migrate to Sphinx/lucene will I be able to get a result similar to the query above. Am a beginner in Sphinx, which of these two should i use or is there anything better.

实际上groupby和搜索'wrdTrk.word like(:word)'是我查询的主要部分,我需要转向布尔搜索以增强用户体验.我的数据库大约有23652826行,数据库基于Innodb,MySql全文搜索不起作用.

Actually groupby and search ' wrdTrk.word like (:word)' is a major part of my query and I need to move to boolean search to enhance user experience. My database has approximately 23652826 rows and the db is Innodb based and MySql full text search doesnt work.

问候 鲁

推荐答案

是.狮身人面像可以做到这一点.我不知道LIKE (:word)的作用,但是您可以在狮身人面像搜索中执行类似@word "exactword"的查询.

Yes. Sphinx can do this. I don't know what LIKE (:word) does, but you can do a query like @word "exactword" in sphinx search.

这篇关于MySql全文或Sphinx或Lucene还是其他?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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