Doctrine Searchable Behavior vs Zend Lucene in symfony

一个人想着一个人 提交于 2019-12-12 19:22:15

问题


I need to search for keywords in 2 table, simple thing

I am undecided about using one or the other? any suggestion performance wise?

Thanks!


回答1:


As cuhuak mentioned, Lucene is a fulltext search. Since it is written in Java, you additionaly need a Java Server (Tomcat for example). If you don't want an additional server, the Zend Lucene implementation (as noted in the comments by Matt Gibson) may also be worth looking into. With an additional server and if you only have a small host, this MAY not be good performance wise. Also, Lucene needs much more configuration and set-up than the Doctrine solutions.

On the performance side of things: Lucene is built to index millions of words and search within these in milliseconds. With millions of words in your "regular" RDBMS, things will get slow. You could set up a fulltextsearch in the database too, but this again needs setup and knowledge what to do.

So a generall thought: if the site is small (in terms of things to searc), go with the Doctrine approach, if you plan to get serious amounts of data, go with Lucene.




回答2:


Lucene has been developed for fulltext search. Do you need this functionality?

If you need only keywords functionality use Searchable Searchable is easer to use than Lucene.

Also consider to use sfDoctrineActAsTaggablePlugin



来源:https://stackoverflow.com/questions/4494961/doctrine-searchable-behavior-vs-zend-lucene-in-symfony

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!