Professional Documents
Culture Documents
This walkthrough describes how to set up Solr for use with Sitecore. It does not cover all con guration
options available in Solr: it only documents con guration details speci c for using Solr in Sitecore.
Note
The Solr server that hosts your Content Search cores can be different from the server that hosts
your xDB Search Index core.
Follow the instructions in the Solr documentation to install Solr. The Solr website lists resources.
The wiki[http://wiki.apache.org/solr/] hosted there is especially useful.
Note
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 1/8
8/28/2019 Walkthrough: Setting up Solr
[#UUID-71d33faa-48fb-ca6d-7c52-f69641fb1112_N1528811068737_body]
You must enable a Solr search provider in Sitecore before you populate an XML schema.
The Enabling a Search Provider setting in the Web.config le tells Sitecore that Solr is
enabled and Sitecore attempts to connect to the Solr server the next time the index is accessed:
Solr uses a de ned schema when it works with documents. You can modify an existing schema
with the Populate Solr Managed Schema tool. This tool automatically populates Sitecore elds
and makes sure all elds that Sitecore needs are present.
You can add more elds to this schema by adding elds to the managed-schema le as long as
you do not change the system index elds. We recommend that you only do this after you have
populated the Solr schema with the Populate Solr Managed Schema tool. You can use the solr
admin schema page to add additional elds.
1. Copy the Solr-provided con guration example folder called _default (or
basic_configs in older Solr versions) from
the [SOLR_DIR]/server/solr/configsets folder to the [SOLR_DIR]/server/solr
folder, and name the copied folder the same as the appropriate index name.
name=[CORE_NAME]
config=solrconfig.xml
update.autoCreateFields=false
dataDir=data
3. Open the managed-schema le under the conf folder of folder created in step 1.
b. In the fields section, add eld con guration for _uniqueid : <field
name="_uniqueid" type="string" indexed="true" required="true"
stored="true"/>
5. Start Solr.
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 2/8
8/28/2019 Walkthrough: Setting up Solr
8. Click Populate.
It is possible to use manual schemas (the "classic" way) by using a Solr schema.xml le:
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 3/8
8/28/2019 Walkthrough: Setting up Solr
1. Ensure Solr is not running. A full restart is needed so that it loads the new con guration.
2. Start Solr.
3. Check the output log les. If there are no errors, then open the Solr administration page.
4. Click Core Admin and then click a core. In this example, there is one core,
called itembuckets :
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 4/8
8/28/2019 Walkthrough: Setting up Solr
If you can see the Solr administration page and do not get any errors in the log les, then Solr is
running correctly.
The solr.search connection string speci es where the Solr server is located.
This setting tells Sitecore that Solr is enabled and so attempts to connect to the Solr
server the next time the index is accessed. If it cannot connect you get an error.
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 5/8
8/28/2019 Walkthrough: Setting up Solr
This setting contains the maximum number of documents to retrieve on a single request if
a limit has not been speci ed in the query, for example, Take(10). It is important to
remember, for performance reasons, when querying how many results will be returned
from the query being run and to handle them correctly, for example by using paging.
When an item is indexed the composed document is saved to the search index. When the
default Lucene provider is enabled then each write is being ushed to a le on the local
disk. When a document is written using the Solr provider the update has to travel over a
network.
When an index is rebuilt a large number of document updates are created, this could
result in a lot of network tra c which is not very e cient. Therefore using batch can help
to optimize the update process as your indexes grow in size.
Batch mode (enabled by default) takes these document updates and only ushes to the
Solr server when the batch has reached a certain size.
As your index grows you may want to increase this batch size to gain the most out of this
process.
Before you can start using the Solr indexing system, you must re-index Sitecore content.
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 6/8
8/28/2019 Walkthrough: Setting up Solr
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 7/8
8/28/2019 Walkthrough: Setting up Solr
Privacy policy[http://www.sitecore.net/Company/Contact/Privacy-Policy.aspx] ·
Legal notice[http://www.sitecore.net/Legal/Legal-Notice.aspx] · DMCA
Notice[https://pro le.sitecore.net:443/dmca_notice] · Copyright © 1999-2019
Sitecore[http://www.sitecore.net/Legal/Copyright.aspx]
https://doc.sitecore.com/developers/92/platform-administration-and-architecture/en/walkthrough--setting-up-solr.html 8/8