- There are few default indexes that are created by Sitecore for internal use.
- We can use 2 of its default indexes namely
sitecore_web_index & sitecore_master_index to build our Site search
functionality or search-based components.
- In case you have only one site developed in Sitecore instance with very few pages and content then you can go for default indexes.
- But in case of multi-sites or large corporate sites, you need to create a custom index specific to your site (which will include only content items below your site node).
So let's see how to create a custom SOLR index.
- Go to the SOLR folder (in my case: D:\SOLR\solr-7.7.2\solr-7.7.2)
- Go to solr folder under server folder (D:\SOLR\solr-7.7.2\solr-7.7.2\server\solr)
- Copy & Paste the Web index folder (in my case:
Sitecore92Testing_web_index) & rename it as a custom index as
highlighted in below screenshot.
- Open the folder and edit the core.properties file. Update the name from web index to custom index.
- We are done creating the custom index in the SOLR folder. To reflect
these changes in our SOLR search, we will need to restart our SOLR services.
- Open Run (Win + R), type services.msc & click OK.
- Go to SOLR service and restart it.
- Once the restart is successful, the new custom index core will get reflected in our SOLR instance.
- We are done with creating the custom index. Now we need to integrate it into our Sitecore instance.
- Go to your Sitecore instance’s Content Search config folder (in my
case:
C:\inetpub\wwwroot\SitecoreDemo.dev.local\App_Config\Sitecore\ContentSearch).
- Copy & Paste the Sitecore.ContentSearch.Solr.Index.Web.config
file and rename it as “Sitecore.ContentSearch.Solr.Index.Custom.config”.
- Open the file in Notepad++, and edit the below-highlighted values
- Once the above changes are done, Save the file and recycle the app-pool of your Sitecore instance.
- We are done with creating the Custom index and integrating it with
Sitecore instance, we now need to rebuild it once so that only specific items will be indexed in it.
- Login to the Sitecore instance and go to Control panel.
- Click on the indexing manager under the Indexing section.
- Unselect all other indexes & select only custom indexes. Click on the Rebuild button.
We are done with creating the custom SOLR index and integrating it with the Sitecore instance. Now you can use it in the same way as we use the default index.
Thank you... Keep Learning... Keep Sitecoring...
Comments
Post a Comment