Situations to prefer Apache Lucene over Solr?

前端 未结 5 1304
孤独总比滥情好
孤独总比滥情好 2021-02-12 20:24

There are several advantages to use Solr 1.4 (out-of-the-box facetting search, grouping, replication, http administration vs. luke, ...).

Even if I embed a search-functi

相关标签:
5条回答
  • 2021-02-12 21:02

    Use Solr if you are more concerned about scalability than performance and use Lucene if you are more concerned about performance than scalability.

    0 讨论(0)
  • 2021-02-12 21:06

    If you have a web application, use Solr - I've tried integrating both, and Solr is easier. Otherwise, if you don't need Solr's features (the one that comes to mind as being most important is faceted search), then use Lucene.

    0 讨论(0)
  • 2021-02-12 21:08

    Here is one situation where I have to use Lucene.

    Given a set of documents, find out the most common terms in them.

    Here, I need to access term vectors of each document (using low-level APIs of TermVectorMapper). With Lucene it's quite easy.

    Another use case is for very specialized ordering of search results. For exmaple, I want a search for an author name (who has writen multiple books) to result into one book from each store in the first 10 results. In this case, I will find results from each book store and to show final results I will pick one result from each book store. Here you are essentially doing multiple searches to generate final results. Having access to low-level APIs of lucene definitely helps.

    One more reason to go for Lucene was to get new goodies ASAP. This no longer is true as both of them have been merged and there will be synchronous releases.

    0 讨论(0)
  • 2021-02-12 21:19

    If you want to completely embed your search functionality within your application and do not want to maintain a separate process like Solr, using Lucene is probably preferable. Per example, a desktop application might need some search functionality (like the Eclipse IDE that uses Lucene for searching its documentation). You probably don't want this kind of application to launch a heavy process like Solr.

    0 讨论(0)
  • 2021-02-12 21:23

    I'm surprised nobody mentioned NRT - Near Real Time search, available with Lucene, but not with Solr (yet).

    0 讨论(0)
提交回复
热议问题