Lucene或Mysql全文搜索 [英] Lucene or Mysql Full text search

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

问题描述

现在,当开始一个网络/移动应用程序项目时,搜索将成为一个重要的变量。从一开始就使用Lucene或者快速部署一个基于MySQL的解决方案并希望获得最好的解决方案会更好吗?解决方案

同样的决定在2010年11月。我是一个mysql的朋友,并试图建立一个搜索应用程序的MySQL首先 - 这工作得很好...
...和快速(我认为它很快):搜索200.000个文件(不超过2-3秒)



我避免花时间在lucene / solr上,因为我想用这段时间来开发应用程序。和:lucene对我来说是新的......我不知道,如果它足够好,我不知道它是什么....
最后:你无法改变一生的习惯。

但是,我运行模糊搜索的不同问题(这在mysql中很难实现)或更像这样(必须从scratch中编码一个使用mysql的应用程序或简单使用的更像这样的solr-feature开箱即可)。
最后,文档数量上升到了一百万,而mysql现在需要超过15秒才能搜索文档。



所以我决定从lucene感觉就像我打开了一扇新世界的大门。
很多功能(我几乎没有编码的应用程序功能)现在都由solr提供,并且可以直接使用。全文搜索要快得多:100万份文档中少于50ms,如果缓存则少于1ms。



所以投资时间已经得到了回报。

因此,如果您想要进行全文搜索: lucene,如果你有更多的数据。
顺便说一下:我使用的是混合构造:在mysql中保存数据,而lucene只是一个索引(几乎没有)存储数据(以保持索引小而快)。


Nowadays when starting a web/mobile app project in which search is going to be an important variable. Is it better to go with Lucene from the start or quickly deploy a MySQL based solution and hope for the best?

解决方案

I had the same decision in November 2010. I'm a friend of mysql and tried to build an search application on mysql first - which works well... ...and fast (i thought it was fast): searching in 200.000 documents (in not more than 2-3 second)

I avoided spending time to lucene/solr, because i would like to use this time for developing the application. And: lucene was new for me... I don't know, if it is good enough, i don't know what it is.... Finally: You can't change the habits of a lifetime.

However, i run in different problems with fuzzy search (which is difficult to implement in mysql) or "more like this" (which have to be coded from scrat in an application using mysql or simple use that "more like this" solr-feature out of the box). Finally the number of documents rises up to a million and mysql needs now more than 15 seconds to search into the documents.

So i decided to start with lucene and it feels like i opened a door to a new world. Lot's of features (i hardly coded application-features) are now provided from solr and working out of the box. The fulltext searches are much, much faster: less than 50ms in 1 million Documents, less than 1ms, if it is cached.

So the invested time has paid off.

So if you think about to make an fulltext search: take lucene, if you have mor than a couple of data. By the way: i'm using an hybrid construct: holding the data in mysql and lucene is only an index with (nearly) no stored data (to keep that index small and fast).

这篇关于Lucene或Mysql全文搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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