Posts

Showing posts from October, 2022

Add Custom Fields in SOLR Index on Crawler

Image
While upgrading the project from Sitecore version 8.2 to 10.2 I faced one scenario to convert the Lucene Search configuration to the SOLR. It’s easier to convert the Lucence configuration to the SOLR if all configurations are defined in the configuration files. You just need to change the type to the Solr Provider and configuration to the defaultSolrIndexConfiguration or if it does not default then define the custom Solr Index configuration . The problem occurs when the index file is generated at runtime and custom fields are added dynamically either on the pipeline or Search Crawler. In my case in Sitecore 8.2 lucence configuration fields were added in the document at runtime on SitecoreItemCrawler . Custom Crawler: Code was written on the custom crawler: Solution: To resolve the above issue and find the solution, I have explored Sitecore.ContentSearch DLL and found out it provides the below method in the IProviderUpdateContext interface.

Sitecore Identity Server: Sorry, There Was an Error

Image
After restoring the upgraded database to the SQL, I tried to login into the Sitecore CMS. The identity server comes with an error " Sorry, there was an error " after successful login. I have checked the Identity server logs files and found the error:  CORS policy execution failed . Solution: Go to the {root-directory}\project-identityserver.local\Config\production and open Sitecore.IdentityServer.Host.xml file and verify the database name. If it is corrects, then check the <AllowedCorsOrigins> section. In my case it was related to the database name, I forget to update the database name and connection string in the identity server. Note: Do not forget to recycle the Identity Server App pool. Happy Sitecoreing  ðŸ˜Š

Sitecore Azure CDN Setup for Media

Image
Sitecore website performance will impact if you have a large number of media items on pages and it comes from the media library. To increase performance, use a Microsoft Azure® Content Delivery Network (CDN) with Sitecore Media in your solution.  Here in this blog post, I am discussing how to configure the Azure CDN with your Sitecore solution so that your media library items are retrieved from the CDN and increase performance. If you are using Sitecore Managed Cloud Service then either you will already have CDN setup on your prod environment or you can create a service request to Sitecore to create an app service for CDN else you can refer to the Sitecore document about CDN setup considerations . Configuration In Sitecore: Before you can setup the Sitecore Media Library to use CDN in your solution you must have Sitecore XP or XM 9.1 or later CDN endpoint Step 1: Go to the path {your Sitecore root instance}\App_Config\Include\Examples

Dot NET Framework Migrator

Image
While upgrading Sitecore to the latest version, updating the project framework is one of the major tasks. For example, If you are planning to upgrade Sitecore from a lower version to Sitecore 10.2 then in your visual studio you need to change the .net framework to 4.8. It is an easier task just to right-click on the project, go to the properties and select the Application option and change the Target framework. But this job becomes tedious if your Visual Studio Solution file has a large number of projects especially if it's a Helix-based solution. You can use an open-source Visual Studio extension tool named Target Framework Migrator . It Migrates all your .Net projects to another .Net Framework Version at once. With this extension, you can update all projects with one click. Once you install this tool it will be available in the Tools menu. Once you click on the Target Framework Migrator options, then in popup windows select the target .ne