Using Solr or Lucene

Last updated Wednesday, November 22, 2017 in Sitecore Experience Platform for Administrator, Developer

Sitecore supports both Lucene and Solr search engines. The search engines are used for searching in the content databases, as well as for searching in a number of operational databases that Sitecore uses for collecting analytics data, test data, and so forth.

When visitors search for content, they use a search engine. Therefore, this search engine must be available from the Internet. On the other hand, the search engine that Sitecore uses for the operational databases does not have to be available from the Internet.

You must use Solr if you have a scaled environment (an environment with more than one server). This means you have

  • two or more content delivery servers
  • two or more content authoring severs
  • separate servers for email, processing, reporting and publishing

Solr supports calls over HTTP(S) which means that the indexes are available to all servers in the environment that require it (content management and processing servers).

Lucene is a file based indexing system, which means if an index is not located on the server that the request is coming from you have to ensure that indexes across all servers remain in sync. This is technically possible but non-trivial, and not supported.

Other reasons for using Solr are:

  • When you need to index large numbers of items (50,000 and up), Solr performs better.
  • Solr is more robust. If your site depends on search as the primary interface, we recommend using Solr.

You can move from Lucene to Solr. The LINQ queries remain the same, but there are differences in configuration and so forth that you need to address. You will also have to rebuild indexes. The move is possible, but it is not a trivial task. You should therefore use Solr if you plan to scale your site (have a distributed setup with multiple servers).

If you do move from Lucene to Solr, be aware that Lucene and Solr score search results in slightly different ways (which can look like there is something wrong unless you know this).

You can mix Lucene and Solr, and, for example, use Solr for xDB and Lucene for content search at the same time. Generally it is simpler to use Solr for everything once you need to use Solr for the operational databases.

Send feedback about the documentation to docsite@sitecore.net.