Surya Narayan
  • Member for 4 years, 11 months
  • Last seen this week
  • Jaipur, Rajasthan, India
Using Powershell Extensions to remove empty <p> tags from all rich text fields
Accepted answer
12 votes

You can use the below script to remove all empty p/P tags (having space or &nbsp;). This script uses the HtmlDecode method of System.Web.HttpUtility class to decode single or multiple ...

View answer
Solr tokenization to split on semicolon character
Accepted answer
10 votes

You can use solr.PatternTokenizerFactory tokenizer to achieve this Define a new fieldtype in solr schema <fieldType name="semicolonDelimited" class="solr.TextField"> <...

View answer
Search in content editor for checkbox field value
Accepted answer
7 votes

Yes, It's possible. Click on Search by a field value as shown in the below screenshot and search for active|1. It will show all items having active checkbox checked. To save queries as default ...

View answer
Getting the datasource of all components inside the page using SPE
Accepted answer
5 votes

You are trying to get Datasource from an item which is retrieved using Get-Item. Instead you should get datasource from Item retrived using Get-Rendering Change this code $Properties = @{ ...

View answer
Get list of Sitecore items updated by Specific User
Accepted answer
5 votes

You can use below PowerShell to get a list of items updated by a specific user in last X days Script $path ="master:/sitecore/content" $items = Get-ChildItem -Path $path -Recurse | ...

View answer
Make Azure AD Login Page The Default Sitecore Login Page
Accepted answer
4 votes

Yes, you need to set loginPage attribute of shell site to $(loginPath)shell/SitecoreIdentityServer/IdS4-AzureAd. This will redirect /Sitecore/Login or /Sitecore to AzureAd login page directly Here is ...

View answer
How can I rebuild the Solr indexes via Powershell?
Accepted answer
4 votes

To rebuild indexes from sitecore powershell you can use below script which will re-index all indexes one by one using namespace Sitecore.ContentSearch $indexes = [ContentSearchManager]::Indexes ...

View answer
Identity Server logs clean-up
3 votes

If you want to do at Sitecore level only then you can add entry for IdentityServer log folder in <agent type="Sitecore.Tasks.CleanupAgent" of CM website but make sure you give delete ...

View answer
Solr Search Model doesn't work without the dynamic field suffix
3 votes

You must have a typematch for type IEnumerable<ID> in your index configuration to make this work. So, create a patch file and include typematch from the below list //Sitecore 8.1 <typeMatch ...

View answer
Getting an item using Powershell having only the URL
3 votes

You can get item by URL using below function. You may have to tweak it for resolving wildcard items. function GetItemByUrl($url){ $url = [System.Uri]::new($url); $siteContext = [Sitecore....

View answer
Find-Item -Index Get latest version
3 votes

If you want to use _latestVersion with Find-Item command then you will need to use -Criteria instead of -Where because -Where uses SearchResultItem class to map the properties whereas -Criteria work ...

View answer
HTTPS to HTTPS 301 redirect for whole domain?
3 votes

This IIS Rule should work for both HTTP and HTTPS <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> ...

View answer
How to increase Solr JVM memory
3 votes

You can also use -m parameter to set memory during executing solr start command. For example, if you want to set memory as 2 GB then you can write the command as below solr start -f -port 8080 -m 2g

View answer
Identity Server logs clean-up
Accepted answer
2 votes

Identity Server uses Serilog (https://github.com/serilog/serilog) for writing logs and a single file sink is configured by default. Which retains 31 files (for one month) by default. If you want to ...

View answer
Handling special characters in SOLR search for sitecore 9.1
2 votes

1.Make sure that you are using preserveOriginal="true" for solr.ASCIIFoldingFilterFactory filter <fieldType name="text_general" class="solr.TextField" ...

View answer
Client certification for Sitecore 9.1.1 Xp scaled (XP1) installation on premises
2 votes

Yes, you can use self-signed client certificates in the production environment. They are just for authentication purposes only. The server just uses it to validate that the request is from a genuine ...

View answer
Connecting console application to XConnect in Azure Sitecore 9.2
Accepted answer
2 votes

You just need to copy below two connection strings from CM app service to your console app to connect to XConnect. <add name="xconnect.collection" connectionString="https://...

View answer
Sitecore Powershell script to add items in array
Accepted answer
2 votes

The only issue I see with your script is that you are creating a variable for each template type. If you have a big list of templates then it would be difficult to manage the script. So, Instead of ...

View answer
Could not find configuration node: databases/database[@id='core'] in content delivery server
1 votes

The issue is that your content delivery server is trying to access core database and core database is not enabled on CD servers. To fix this, you need to either find specific config/code/task which is ...

View answer
Sitecore xConnect client certificates renewal
1 votes

You should generate new cert and use it. It's not recommended to allow invalid client certs especially on Prod. They are used for authentication so make sure client cert is valid and ...

View answer
Connecting two Azure services to access XConnect
Accepted answer
1 votes

It seems that you have not installed client certificate on app service from which you are trying to connect to xconnect. Go to connectionstring.config of your website and note thumbprint of the ...

View answer
Sitecore Powershell Script to Delete All Items in Results
1 votes

You can try for loop instead of foreach loop if you want to update collection within the loop Example - for($index = $allData.Count-1; $index -ge 0; $index--) { $item = Get-Item -Path "master:" -...

View answer
Writing an IIS rewrite rule for the Sitecore control panel URL
1 votes

It seems you have a rule with type="CustomResponse" statusCode="403". So, try placing below rule before CustomResponse rule. Updated Rule - <rule name="Redirect HTTP to HTTPS - Staging Knowledge ...

View answer
Why the Publishing Settings --> Targets are all unchecked
1 votes

To have all checkboxes checked by default, Navigate to Publishing section of About Us item and check all targets in Publishing targets field as shown below and then if you open the dialog Publishing ...

View answer
How to add a css class dynamically for selected menu item?
Accepted answer
1 votes

You can add a conditional statement for li to add active class on it Example - <li class='<%= Sitecore.Context.Item.ID.ToString() == Eval("ID").ToString() ? "active" : "" %>'> {Add code ...

View answer
Not a valid email address
1 votes

Yes, both regex values should be the same as they are part of one application and the validation rules should be same for entire application unless there is a business requirement to deal with two ...

View answer
Creating a custom Solr core using solr-init container in docker
0 votes

I do not have a local setup to try this out but this could be due to the wrong SolrEndpoint parameter. Can you pass solr endpoint instead of C:\data? Because that parameter is being used to form ...

View answer
Crawling log - Unable to connect to Solr
0 votes

Solr does not support both HTTP and HTTPS at the same. You can only use one of them at a time. So, make sure to update your config files(e.g. \App_Config\ConnectionStrings.config) to use only https://...

View answer
Task Cleanup Agent doesn't clean up everything
0 votes

If you want to cleanup everything then your pattern should be pattern="*.*" and you can also set recursive="true" if you want to cleanup sub directories too. Example - <remove ...

View answer
Set SOLR master/slave model for Sitecore
0 votes

Yes, you need to first install Sitecore and then configure Master/Slave. Here are the steps to follow - First, you need to install Sitecore with single Solr instance Then you need to create ...

View answer