Skip to content
November 21, 2015 / kiranpatils

Basic ways to troubleshoot Sitecore indexing configurations

Challenge:

Few months back, we were facing Indexing related challenges. CM and CD indexes were different. During that period we learnt some way to identify how to troubleshoot Sitecore indexing. I thought it will be good idea to share with you folks as well

Solution:

We’ve built a simple pag which prints important index information as shown below:

2015-11-21 12_59_59-Test PageCode is very straight forward:

ISearchIndex isearchIndex = ContentSearchManager.GetIndex("YOURINDEXTOTROUBLESHOOTNAME");

if (isearchIndex != null)
{
	stringBuilder.AppendFormat("Index Found {0}. Details are as under",
	qsIndexName);
	stringBuilder.Append(" ");

	stringBuilder.AppendFormat("Index Name : {0}  ",
	isearchIndex.Name);                              
	stringBuilder.AppendFormat("Index IsClean : {0}  ",
	isearchIndex.Summary.IsClean);
	stringBuilder.AppendFormat("Index  IsHealthy: {0}  ",
	isearchIndex.Summary.IsHealthy);
	stringBuilder.AppendFormat("Index  IsOptimized: {0}  ",
	isearchIndex.Summary.IsOptimized);
	stringBuilder.AppendFormat("Index  LastUpdated: {0}  ",
	isearchIndex.Summary.LastUpdated);
	stringBuilder.AppendFormat("Index  NumberOfDocuments: {0}  ",
	isearchIndex.Summary.NumberOfDocuments);
	stringBuilder.AppendFormat("Index  NumberOfFields: {0}  ",
	isearchIndex.Summary.NumberOfFields);
	stringBuilder.AppendFormat("Index  NumberOfTerms: {0}  ",
	isearchIndex.Summary.NumberOfTerms);
	stringBuilder.AppendFormat("Index  OutOfDateIndex: {0}  ",
	isearchIndex.Summary.OutOfDateIndex);                              

}
else
{
	stringBuilder.AppendFormat("Index Not Found : {0}",
	qsIndexName);
	stringBuilder.Append(" ");
}

Make sure you have page with this code on your CM and CD. And pass your index name which
you are trying to troubleshoot. Then make a change in your Sitecore Content tree like add one item and then check on CM you should see one more document.

Now, publish it and check index info on CD Server  it should increase document count on CD as well. If not then it means your index configurations are not proper. And usually we do check following things:

  1. Check your Sitecore.ContentSearch.Lucene.Index.<DBNAME> file and ensure right Index strategies are configured  : http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2013/04/sitecore-7-index-update-strategies.aspx and usually people add new publish target. But forget to add index strategy
  2. Second thing is verify your EventQueue and History Engine configurations. Because Sitecore relies on it. Good to read : http://sitecoreblog.blogspot.in/2012/02/remote-events-how-to-investigate.html and i can recall once our indexes were not getting built and running following SQL Statements on each database fixed it :
DELETE FROM EventQueue;
DELETE FROM [Properties] WHERE [Key] LIKE 'EQStamp%'; 

I missed any scenario? Feel free to add

Reference:

  1. http://kamsar.net/index.php/2014/01/have-two-web-databases-dont-forget-the-indexupdatestrategy/
  2. http://stackoverflow.com/questions/25692932/sitecore-lucene-content-delivery-server-index-not-updating-on-publish
  3. http://sitecoreblog.alexshyba.com/search_index_troubleshooting/

Happy Indexing! 🙂

Advertisements

One Comment

Leave a Comment
  1. IvanL / Nov 23 2015 10:28 pm

    The info page you build is available under the control panel > indexing manager. For CD servers this might not be accessible through sitecore itself but you can use this URL: /sitecore/shell/default.aspx?xmlcontrol=IndexingManager

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: