Surendra Sharma

Surendra Sharma

Search This Blog

Tuesday, November 1, 2016

How to audit Sitecore project quickly



It’s always a challenge for Architects to audit the Sitecore based projects.

Sitecore Audit
Sitecore Audit


One should always follow best practices described by Sitecore. But still there are many occasion where development team itself can self-audit their project especillay on CM, CD and production environment.

Team can use great tool Sitecore Diagnostic Toolset for this audit purpose.

You can download this tool from Sitecore Marketplace.

Steps to run this tool

Double click on downloaded tool

Welcome screen
Welcome screen


Select your Sitecore instance

Select Sitecore instance
Select Sitecore instance


Run against Environment like CM, CD etc.

Select environment
Select environment


Click on generated link to view the report

Report Link
Report Link


Check generated HTML Report for errors.

Generated report
Generated report



One should focus on errors and warnings in this reports.

That’s it. Simple and straight forward solution. 

I hope you like this Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you.

Friday, October 28, 2016

All About indexing an external database in Sitecore



This post is about indexing an External Database in Sitecore.

Flow of external indexing
Flow of external indexing


So will index data of external database tables and use LUCENE search to get result from index files. If you are new to LUCENE search, please refer my article on Lucene search.

There is one great post on the same topic by Cameron Palmer.

I setup most of the things according to this post and its work like a charm.

However for Sitecore 8.0, I need to do below changes.

  • You need to add reference of Sitecore.ContentSearch.dll, Sitecore.ContentSearch.Linq.dll, Sitecore.ContentSearch.Linq.Lucene.dll and Sitecore.Kernel.dll.
  • I added my fields in "<fieldNames hint="raw:AddFieldByFieldName">" section in Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config.
  • I created new config file "People.Index.config" in "Include" folder as


<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
        <indexes hint="list:AddIndex">
          <index id="People_Index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
            <param desc="name">$(id)</param>
            <param desc="folder">$(id)</param>
            <!-- This initializes index property store. Id has to be set to the index id -->
            <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
            <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
            <strategies hint="list:AddStrategy">
              <!-- NOTE: order of these is controls the execution order -->
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
            </strategies>
            <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
              <policies hint="list:AddCommitPolicy">
                <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
                  <Limit>300</Limit>
                </policy>
              </policies>
            </commitPolicyExecutor>
            <!--<locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>web</Database>
                <Root>/sitecore</Root>
              </crawler>
            </locations>-->
            <locations hint="list:AddCrawler">
              <crawler type="Testsite.ASPNET.UI.PeopleCrawler, Testsite.ASPNET.UI">
              </crawler>
            </locations>
            <enableItemLanguageFallback>true</enableItemLanguageFallback>
            <enableFieldLanguageFallback>true</enableFieldLanguageFallback>
          </index>
        </indexes>
      </configuration>
    </contentSearch>
  </sitecore>
</configuration>


You need to change two yellow highlighted things in this "People.Index.config" file as
  • <index id="People_Index" name
  • Class type details with assmbly name as <crawler type="Testsite.ASPNET.UI.PeopleCrawler, Testsite.ASPNET.UI">

That's it from Sitecore point of view.

After this next challenge is how to rebuild/refresh index for any DML operation done on external database tables. For this you can refer my article "Rebuild Sitecore index on real time basis from external system".

Index rebuild process takes time on Sitecore side. So you must call index rebuild method in async function in C#.

I hope you like this Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you.