Skip to main content

Posts

Showing posts from March, 2023

Sitecore Media Cache : How to find media file in it?

In Sitecore Media Cache, the images are stored in MediaCache folder using a specific convention. This means if you need to locate an image in MediaCache folder, you need to understand this convention else you have to be really lucky to be able to find your image in MediaCache. I have many times figured this out earlier and then have also forgotten it when it was not needed. Recently, while working on a production issue, I again had to recall it  to know if a media file is being served from MediaCache or not. So this time I decided to document it and share it with other developers in case they too struggle with it. If you go to App_Data/MediaCache on your Sitecore instance, this is how a typical site folder in it looks like. All the media files for sites are cached in their site specific folders only -  If you go one level inside these folders, you will see this -  The above snapshot is from an example site which has few media items only. Your actual MediaCache folder may have hundreds

My Samsung Galaxy phone not charging and how I fixed it

I have been using Samsung Galaxy F62 for 2 years now without any problem until recently when I would plug the charger in to my phone, it would show all the signs of phone getting charged and after 20-30 seconds it just stops charging. The phone automatically stops showing any signs of charging. This happened once earlier as well but at that time, it worked fine on its own  after few reattempts. I assumed that it was a minor glitch and the problem is solved but that was not the end of it. Soon, the problem resumed and I started trying all the different mechanisms suggested on internet to fix this problem. I tried - using different charging adapters in case the charger was faulty using different charging cables in case the cable was broken  tried cleaning my charging port in case the port had some dirt running charging diagnostics/troubleshooting in my phone which detected nothing Finally, my phone battery drained completely and I had no other option than to visit a near by mobile techni

SOLID Principles in Software Development

  The SOLID principle was introduced by Robert C. Martin, also known as Uncle Bob and it is a coding standard in programming. This principle is an acronym of the five principles which is given below- Single Responsibility Principle (SRP) Open/Closed Principle Liskov’s Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP) Single Responsibility Principle:  A class should have only one reason to change This  means every class should have a single responsibility or purpose. The class shall be updated only when a the behavior for this single responsibility changes. For E.g. If a class is responsible for login logic, then that is all it should do. Any other similar functionalities like Registration or Change Password should be implemented separately. As such, only when a change is required in Login logic will cause the class to be updated. If we keep updating a class for adding features which are not related to a single purpose, it makes the

Solr Search for Sitecore - Notes --Draft

SOLR SEARCH QUICK NOTES http://www.solrtutorial.com/solr-query-syntax.html BASIC CONCEPTS Solr prepares indexes. Indexes contains documents and documents contains fields. Documents can be assumed as rows in a table and fields as columns in tables. Before adding documents to index, we need to specify the schema. (not advisable to change schema after documents have been added).  The schema declares - what kinds of fields there are which field should be used as primary key which fields are required how to index and search each field When we search for a word, the word undergoes transformation to get converted to a token. SOLR then looks for these tokens in its indexes. Each token contains references to pages where it was found when SOLR was crawling and this is how search results are returned. All fields are not searchable. Many of them are maintained in indexes so that when a match is found, the field values may need to be displayed in the search results. This is done by following settin

Script to renew self-singed certificates in Sitecore

This one is an article to spread awareness about script solutions available in community but not popular.  As my self-signed certificates for Sitecore 10.0 instance expired, I want to use SIF or CLI to renew them and best also to replace thumbprints to minimize manual work. Is this possible with SIF or CLI? Or is there any ps1 script I could use. We have a LOT of test environments. As the certs have been expiring, I was complaining about the manual process I was using to change/update these. My clever co-worker Karl bowled up a powershell script that has been such a help!  This will generate a new CA cert for you to base all your self-signed certs on, or it will use one you already have. Put the pfx file in the same directory as the script. It displays all the sites in IIS and you pick the one to update - say a Sitecore 9 xconnect site, changes out the cert in the bindings, updates the thumbnails where needed in config. So easy once you've used it a couple of times. Enjoy. https://

Solr Search facet values limited to 100 only in Sitecore SXA

The Problem Recently, a Sitecore developer reported an issue where he could not get more than 100 values for a facet field in SXA search component. He tried updating Query.MaxItems and also  XA.Foundation.Search.QueryMaxItems but still did not get more that 100 values for the facet field. The Research I started looking into this out of curiosity. I checked Sitecore configs and did not find any other setting which could be affecting it. I realized soon that this was most likely something limited on SOLR side. On researching, I found out that indeed this is related to SOLR default settings. Below is the snapshot from documentation about it and more info can be found here -  The Solution So, on your SOLR Server, edit the solrconfig.xml for the index you are using. It is found in the conf folder of your index. Find the requesthandler you are using, for e.g. "/select", and add <str name="facet.limit">-1</str> as in snapshot below -       Repeat this for ea