Sunday, October 16, 2016

Sitecore Tagging Surprises


Sitecore tagging is immensely powerful out of the box starting Sitecore 7+.  You can tag any items( including bucketed items)
The below links will get you started on the basic features -

https://visionsincode.wordpress.com/2014/11/16/tagging-is-fun-in-sitecore/

https://community.sitecore.net/technical_blogs/b/sitecore_7_development_team/posts/content-tagging-with-sitecore-7

https://doc.sitecore.net/sitecore_experience_platform/content_authoring/managing_items/general/add_a_tag_to_an_item

Now, coming to the surprises...


  1. While working with the basics,  the __Semantics field on my local sitecore instance did not look anything like the articles explain.  After some pondering,  it turns out my 'raw' view was checked.  So, for the multi-value search field to behave and allow selection as expected make sure this is unchecked.
  2. After adding some new tags into tag repository(),  when i go back to tagging section of my item, I did not see the newly added tags in the selection list.   This is because tagging depends and reads from indexes.  when i re-built my indexes, I could then see the new one's
  3. Since, tagging is so dependent on indexing,  selecting a good indexing strategy is very important.  Doing this operation only as often as needed and not overdoing goes long way.
To tackle #3,  it would be handy to know the default indexing strategies on master and web databases.  For master, the default is syncMaster and for web database, the default strategy is onPublishEndAsync.   You can apply different one's as needed, but, in our case the defaults would just do it. 

You can read more on indexing strategies available through Sitecore OOTB on the below article, Good reads. :)


https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/search_and_indexing/indexing/index_update_strategies

https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/sitecore-7-index-update-strategies

https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/search_and_indexing/indexing/rebuild_search_indexes

Thursday, October 13, 2016

Sitecore URL Duplication

Sitecore is amazing when it comes to how it can resolve a URL seamlessly to an item and how we can tune that based on requirements and project demands.
In most of the blogs out there - Good reads
https://jammykam.wordpress.com/2015/07/13/seo-friendly-urls-in-sitecore-prevention-is-better-than-cure/  - My Fav
http://reinoudvandalen.nl/blog/using-replacement-characters-in-sitecore-the-right-way/
https://www.cmsbestpractices.com/add-seo-value-by-replacing-spaces-with-dashes-in-sitecore/

you will see how you can tackle LinkManager using  to ensure you always have a good SEO friendly URL using <encodeNameReplacements> and how to avoid the side effects of this by ensuring we do not allow hyphen in item names using "InvalidItemNameChars"

Now, there are other problems we will have to deal with.  Google does not like duplicate content, which means when two URL's yield same result, in our case render same item content.  It means it is duplication.

But, though spaces are replaced by hyphens internally, it does not do anything when user or say some refferal link some where actually has spaces
For example - www.domain.com/test%20page and www.domain.com/test%20page would yield same page/content

Not Good...Google would not like it!

So, good SEO options are either do a 404 on space version(%20) above or do a 301 re-direct.  Canononical links might help a little if you cant do both of the above.

You could also you IIS re-write rules to replace spaces with '-' instead of %20

Wait for more...


  

Item Publish and Save Random Errors(Coveo)

Sitecore Item Publish and Save Errors

One day, though I did not do any specific config level changes, I started getting lot of errors, items were not saving, publish was not happening.  Same object reference errors on every single major operation on my sitecore instance.
I looked at the logs and see bunch of Coveo related errors, Yes, I had Coveo installed on this instance.  I ran the diagnostic tool of Coveo and see bunch of services having issues.  Even the indexing was broken.  It seems Coveo patches on to lot of Item pipelines like save, publish, etc.,
To debug this, there are few common steps you need to do and for most cases below should work.
In my case, I was using Windows Credentials for Coveo services and I had changed my password. ;)
But, it could be other service related issues that could be causing it -  So, the traditional magic steps are -

1. Ensure Coveo Diagnostic is all green
2. Go to Windows Services and ensure all Coveo services are up and running.
  Note - Some times the services show up as running, but, infact they would be broken.  When issues persist, try to stop and restart service after ensuring credentials are correct.
3. Tip - wait for few seconds before starting the service after you stop it
4. Re-index all Coveo Indexes
5. Check Diagnostics again to ensure

These steps should help most of issues specifically when everything is installed correctly initially.
As always Coveo first time install is always rough on newbies.  But, slowly you will get good hang of it, once you know the components.

Good Reads -
https://developers.coveo.com/display/public/SitecoreV3/Troubleshooting+Problems+Using+the+Coveo+Diagnostic+Page;jsessionid=2E0BEDF7A39D390CB791743AAE57FF87

https://developers.coveo.com/display/public/SitecoreV3/Resolving+Coveo+for+Sitecore%27s+Most+Common+Issues