0% found this document useful (0 votes)
39 views

Sitecore Questions 04122023

Uploaded by

neotheerror
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Sitecore Questions 04122023

Uploaded by

neotheerror
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 40

1-: What is pipeline and processor?

A-: Series of actions which is executed in a sequence to achieve specific


objective.
The action which are getting executed is called as Processes.
And the class which execute these processes are called Processor.

Core Pipelines
This chapter describes the pipelines defined within the
/configuration/sitecore/pipelines element in the web.config file. These
pipelines tend to define system processes and are sometimes referred to as core
pipelines.
This chapter contains the following sections:
 HttpBeginRequest Pipeline

DMS Pipelines
The DMS introduces additional pipelines through the
Sitecore.Analytics.config include file. It also adds processors to existing
CMS pipelines.

Overview
This section describes the important pipelines that are specific to the Sitecore
Digital Marketing
System (DMS).
The Sitecore Digital Marketing System (DMS) uses the
/App_Config/Include/Sitecore.Analytics.config file to define several pipelines and
update pipelines in the Web.config file.

2-: What is UserSwitcher() and SecurityDisabler() and for what purpose it is used?
A-: Sitecore request are executed in the context of the current user. In non logged
in case, request are made in the context of anonymous user.
For editing an Item, a user should have proper permission. So both
UserSwitcher() and SecurityDisabler() are used to change the security context
in Sitecore.

>UserSwitcher() - UserSwitcher() allows a segment of code to run under a


specific user instead of current context.

using(new UserSwitcher(user)){ <code to update> }

>SecurityDisabler() - SecurityDisabler() elevates the user's


permission(temporarily) to administrator rights and so context user will be able to
do
anything on the system.

using(new SecurityDisabler()){ <code to


update> }

This is potentially very dangerous to use and


errors to potentially be very costly. Anything done with the SecurityDisabler
will show up as being done by the Sitecore\
Anonymous role.

3-: Steps to create\update\delete any sitecore items.


A-: There are 7 steps that needs to follow to create\update\delete and Sitecore
item. They are:
1. Change Security Context
2. Get Master Database
3. Retrieve existing Item or Create new one
4. Put Item into editing state
5. Set Item field values or perform operation you need
6. End editing to save changes
7. Publish your changes

4-: What is layers in Sitecore?


A-: Sitecore loads all the configuration in alphabetical order thus we generally
add our custom patches within folder named "z" and we prefix patch
file names with "z", so that last file used to overwrite the final
configuration. From Sitecore 9 onwards Sitecore introduces concept of "Layers"
which controls the execution. So Sitecore has divided all the configuration
files into different layers. There are multiple layers which have been
created by the Sitecore. They are:

>Sitecore Layer :: It contains all default standard Sitecore configuration


files which are related to Sitecore Components & features. Files related to
this layer is stored in "Sitecore" folder inside
"App_Config" folder.

>Modules Layer :: This is reserved for Sitecore and it contains configuration


files related to Sitecore official modules. Files related to this
layer is stored in "Modules" folder inside "App_Config"
folder.

>Custom Layer :: Contains the patch files you create in order to modify
settings in the default Sitecore configuration. Files related to this layer
is stored in "Include" folder inside "App_Config" folder.

>Environment Layer :: Contains the patch files you create to configure Sitecore
for different environments. Files related to this layer is stored
in "Environment" folder inside "App_Config"
folder.

These layers are defined in Layers.config file:

<layer name="Custom" includefolder="/App_config/Include/"

5-: Sequence of Patch file execution.


A-: Patch file created in all layers are executed in below mentioned sequence:

Layers execution of sequence :: Sitecore --> Modules --> Custom --> Environment

Files execution of sequence within each layers :: By default - Each subfolder


and within that each folder/file by alphabetical order.

6-: What is loadOrder atibute?


A-: loadOrder attribute is basically used to define how your patch file execution
will happen.

<layer name="Custom" includefolder="/App_config/Include/"


<layer name="Custom" includefolder="/App_config/Custom/"
<loadOrder>
<add path="Folder3" type="Folder" />
<add path="Folder2/mysite.config" type="File" />
<add path="Folder1" type="Folder" />
</loadOrder>
So sequence of execution will be:
1st -: Folder3 - All files
2nd -: Folder2 - mysite.config
3rd -: Folder1 - All files
4th -: All files - Root Folder
5th -: All Files - Subfolder

7-: What are Server Roles in Sitecore?


A-: Sitecore 9.0 onwards, Sitecore introduce Server Roles in configuration. So
basically now we can define various Server Roles in Sitecore itself.
By default Sitecore has defined Server Roles which are as follows:

>ContentManagement :: Enables content editors to create and publish content


to a website.

>ContentDelivery :: Makes your web content available to your website


contacts.

>Processing :: Extracts information from captured, raw analytics data and


transforms it into a form suitable for use in reporting application.

>Reporting :: Fetches reporting data from various data sources, such as the
collection and reporting databases, to use in Sitecore reporting application.

>Standalone :: A single Sitecore instance performing all server roles. This


is default role.

8-: How role based configuration is done in Sitecore 9 and above version?
A-: Sitecore allowed developers to define your server instance role in the
App.config.

<add key="role:define" value="LocalInstance" />

You can have your own role and multiple roles to the single instance

<add key="role:define" value="ContentDelivery, UATInstance" />

In the patch file you can configure which instance the configuration is
applied.

<agent type="Sitecore.Tasks.HtmlCacheClearAgent"
role:require="ContentDelivery">
<patch:attribute name="interval">00:10:00<patch:attribute>
</agent>

We can use "OR", "AND" and "NOT" operators to configure the configuration in
Sitecore.

Configuration is done programatically and no multiple files.

9-: Multisite configuration.


A-:
:: Maultiple Domain Same Site - example.com, www.example.com, my.example.com,
mynewdomain.com

>https://mywebsite.com

<site name="mywebsite" patch:before="site[@name='website']"


hostName="mywebsite.com|*.mywebsite.com|mynewwebsite.com"
virtualFolder="/"
physicalFolder="/"
rootPath="/sitecore/content"
startItem="/mywebsite"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"/>
</sites>

:: Same Domain Multiple Site

>https://mywebsite.com

<site name="mywebsite" patch:before="site[@name='website']"


virtualFolder="/"
physicalFolder="/"
rootPath="/sitecore/content"
startItem="/home"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"/>
</sites>

>https://mywebsite.com/a

<site name="mywebsiteA" patch:before="site[@name='website']"


virtualFolder="/a"
physicalFolder="/"
rootPath="/sitecore/content/Website A"
startItem="/home"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"/>
</sites>

>https://mywebsite.com/b

<site name="mywebsiteB" patch:before="site[@name='website']"


virtualFolder="/b"
physicalFolder="/"
rootPath="/sitecore/content/Website B"
startItem="/home"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="50MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"/>
</sites>

10-: Custom Processor Class


A-:
1st - Create a class CustomPipelineArgs to enter all custom pipeline
arguments.

using Sitecore.Pipelines
namespace Sitecore.Foundation.Custom.Pipeline
{
public class CustomPipelineArgs : PipelineArgs
{
//Your Arguments
public string MyArgs {get; set;}
}
}

2nd - Define a processor class i.e. action class

namespace Sitecore.Foundation.Custom.Pipeline
{
public class CustomProcessor
{
public void Process(CustomPipelineArgs args)
{
//Your logic
}
}
}

3rd - Define configurations

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<CustomPipeline>
<processor
type="Sitecore.Foundation.Custom.Pipeline.CustomProcessor,
Sitecore.Foundation.Custom.Pipeline" />
</CustomPipeline>
</pipelines>
</sitecore>
</configuration>

11-: How to envoke pipeline at run time?


A-: CorePipeline.Run("CustomPipeline", customPipelineArgs);

12-: How to customize existing processor?


A-: To overwrite existing processor we have to follow below steps::
Step 1 :: Identify the process which you want to overwrite. Inherit that
class into your custom class. For example lets overwrite "SiteResolver"
class. Then you have to inherit "SiteResolver" class into your
custom class like below

public class CustomSiteResolver : SiteResolver

Step 2 :: Overwrite the constructor of the existing process class like below

public CustomSiteResolver(BaseSiteContextFactory
siteContextFactory) : base(siteContextFactory)
{}

protected CustomSiteResolver(BaseSiteContextFactory
siteContextFactory, bool enableSiteConfigFiles) : base(siteContextFactory,
enableSiteConfigFiles)
{}

Step 3 :: Then you have to write the Process and if you have any arguments to
be customized then you have to inherit the Process class in arguments class

public override void Process(HttpRequestArgs args)


{
//Logic
}

So, complete code should look like below.

using Sitecore.Pipelines.HttpRequest;
namespace Sitecore.Foundation.Custom.Pipelines
{
public class CustomSiteResolver : SiteResolver
{
public CustomSiteResolver(BaseSiteContextFactory
siteContextFactory) : base(siteContextFactory)
{}

protected CustomSiteResolver(BaseSiteContextFactory
siteContextFactory, bool enableSiteConfigFiles) : base(siteContextFactory,
enableSiteConfigFiles)
{}

public override void Process(HttpRequestArgs args)


{
//Logic
}
}
}

Step 4 :: Create the patch file and add the configuration to overwrite the
Process

<configuration
xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<httpBeginRequest>
<processor
type="Sitecore.Foundation.Custom.Pipeline.CustomSiteResolver,
Sitecore.Foundation.Custom.Pipeline"

patch:instead="processor[@type='Sitecore.Pipelines.HttpRequest.SiteResolver,
Sitecore.Kernel']" />
</httpBeginRequest>
</pipelines>
</sitecore>
</configuration>

13-: What is content workflow and why it is required?


A-: It is a flexible and controllable way of content creation, maintenance and
review. So whatever content is creating, the process of creating it,
maintaining it and review it is called as a workflow.

So content is created by "Content Creator", then "Content Reviewer" will


review the content and finally "Content Publisher" will decide when to
publish the content.

This is required to ensure that the content created is error free,


gramatically correct, no copyright issue, legally correct etc before moving
the content goes live. So this complete process is called content workflow.
A workflow is a series of predefined states that reflect the work
processes and procedures for creating web content in your organization.

14-: Workflow Items


A-: Workflow items are Workflow, State, Command and Action

Workflows
Sample Workflow ================================Workflow
Draft --------------------------------State
Submit -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Command
_OnSave
Awaiting Approval -------------------------State
Approve with Test
Validation Action
Launch Create Test Dialog ~~~~~~~~~~~Action
Approve =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Command
Validation Action ~~~~~~~~~~~~~~~~~~~Action
Reject =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Command
Approved ---------------------------------State
Auto Publish ~~~~~~~~~~~~~~~~~~~~~~~~~~~Action

15-: What is Workbox?


A-: The Workbox gives you an overview of all items that are in workflows and
enables you to manage these items. In the Workbox, you can see the editing
history of items in the workflow, each item's workflow state, and the no. of
items in each workflow state. In a single word Workbox is just like a
dashboard of the history of your items.

16-: What is item bucket and when to use it?


A-: Large no. of items in content tree will decrease the performance of CMS. So,
to improve the performance Sitecore provides an option called Item Bucket.

An item bucket is a container that you can use to hide many items and still
eaisily retrieve and work with these items. The only way to find bucket
items is to use the Sitecore search engine.

When you store items in an item bucket, the parent-to-child relationship


between the items is removed, and instead the items are organised in a folder
structure according to the date and time they are created.

So, the best practice is to have maximum 100 items under node for better
performance. Also if tree structure or you can say parent-child relationship is
not important

17-: Advantage of item bucket?


A-: 1. Items will be automatically organised in a logical format that increases
the performance of the search engine.
2. A single item bucket can store millions of content items without slowing
down the UI or congesting the content tree.
3. You can create as many item buckets as you want. This lets you split up
your item buckets into logical containers, for example one for products and
one for articles.

18-: How to create item bucket?


A-: We can create bucket like below:

Step 1 :: Select the node/folder you want to make as item bucket.


Step 2 :: Then go to Main Menu > Configure > Bucket

Once you click on the bucket then it will convert that folder into item
bucket.

19-: What will happen when you add any new item in the node/folder you have made as
item bucket?
A-: We will get below mentioned warning:

Warning on the Item - Item is not made bucketable thus not hidden

For adding any new item in the bucket, we should make it bucketable which
can be done at Item Level or Standard Value level.

-Go to standard values of the template and select "Buckets" checkbox in View
Menu
-Go to "Item Buckets" section and select "Bucketable" checkbox.

Now if you add any item of same template in a bucket(Folder/Node), you will
see by default date wise folder structure. There is an Insert Option for
"Saved Search" which allows user to quickly find items in a bucket based on
previous searches.

20-: What is Revert and Sync in the context of "Item Bucket"?


A-: Revert - It removes the bucket designation from an item and removes all items
from the the internal bucket data structure.
Sync - It re-indexes all items under the bucket. This is used when a
configuration change was made to the bucketed on previous searches.

21-: Sitecore default user.


A-: Below are few Sitecore default users:

>sitecore\admin - A predefined administrator user.

>sitecore\anonymous - A user who only has access to the login screen of the
website. This is used for users who will go on to access the application
framework section of the website.

>sitecore\Services API - A default impersonationg user role is used in


Sitecore.Services.Client

>extranet\anonymous - A user who is viewing the free to access parts of a


website.

>default\anonymous - A user who is assigned to an unauthenticated visitor


who is viewing a website that does not have an assigned domain.

>creator\owner - A virtual role that refers to the user specified in an


item's item/owner field.

22-: Role A
Role B

> Read Item


A > Read/Write Item A
> Read/Write
Item B > Delete Item A
> Denied
Item C > Read Item D

> Denied Item E

Role C

> Read/Write Item A

> Delete Item A

> Read/Write Item B

> Denied Item C

> Read Item D

> Denied Item E

23-: Conflicting Rule for access right.


A-:
1> Denied <----- Allowed - Access right : Denied override Allowed

2> User <----- Roles - Security accounts : Access rights assigned to a


user account override access rights assigned to a role.

<----- descendants - Item Access rights assigned


specifically on an item override access rights specified for the

3> Specific descendants on the


parent item.
^
<----- Inheritenance - Access rights assigned
specifically on an item or on the descendants of an item override the
Inheritenance
access rights.
24-: What is Virtual user?
A-: Virtual user is a user object created in a memory that do not physically exist
in the security database. This user can be assigned
administrative rights, roles etc. and can be used for login. Once a virtual
user has been logged in, it is used by the system as if it
was a 'real' user.

25-: How virtual user is created in Sitecore?


A-: Following step will be followed to create a virtual user:

Step 1:: Create Sitecore roles in Sitecore with same name as in external
service.

Step 2:: Apply permission to Sitecore Items as per the requirement to your
role in the security editor.

Step 3:: Now on login button, authenticate your user against external
service and external service will return you the user object
You would need unique user id and the role of next step.

Step 4:: Build virtual user in external Sitecore domain using unique user id
which you must have got from external service.

Step 5:: Add role (as mentioned in Step 1 it should be same as Sitecore
Role) to user.

Step 6:: You can setup custom properties if needed to the Virtual user if
needed.

Step 7:: Now login to Sitecore.

-Build Virtual User: For all these activities we have to use


"AuthenticationManager" class.

AuthenticationManager.BuildVirtualUser("external\\username",true);

-Add Role:

virtualUser.Roles.Add(Sitecore.Security.Accounts.Role.FromName("extranet\\
Role A"));

-Log In

Sitecore.Security.Authentication.AuthenticationManager.LoginVirtualUser(virtualUser
);

##### Language Fallback


###################################################################################
##

28-: Language fallback type.


A-: Three types of language fallback:

1> Item Level Fallback - It enables you to setup an 'empty' item version in
a given language so that it falls back to another language version,
including all its field.
2> Field Level Fallback - It enables you to specify on a single field, which
field values that you want to localize and which field values that
you want to fall back to another
language.

3> Dictionary Level Fallback - Item-level fallback is enabled by default on


the template that dictionary entries are based on.

29-: Configure Language Fallback


A-: In CMS configure field..... System > Languages > <respective language item
e.g. en-CA>. > field name 'Fallback Language'.

30-: Configure item-level Language Fallback.


A-: In CMS select the item for which you want to configure Language Fallback. Then
configure the checkbox field 'Enable Item Fallback' under the Advanced section

31-: Configure field level Language Fallback.


A-: In CMS go to the required field item and once you select the field for which
you want to configure Language Fallback there you will see

1. the checkbox field 'Enable field level fallback' - to enable language


fallback for all the language versions of the current field. This applies to all
the
currently available language versions of the field and any new language
versions that you create.
version of the current item.

2. the checkbox field 'Enable versioned field level fallback' - to enable


language fallback for only the current language versions of the field.

32-: Configure Website level Fallback.


A-: You can enable Language Fallback for each relevant site

Configuration file : \Website\App_Config\Include\


Sitcore.Language.Fallback.config

Attributes are
- enableItemLanguageFallback
- enableFieldLanguageFallback

<sites>
<site name="shell">
<patch:attribute
name="enableItemLanguageFallback">true</patch:attribute>
<patch:attribute
name="enableFieldLanguageFallback">true</patch:attribute>
</site>
<site name="website">
<patch:attribute
name="enableItemLanguageFallback">true</patch:attribute>
<patch:attribute
name="enableFieldLanguageFallback">true</patch:attribute>
</site>
</sites>

##### Experience Database (xDB)


###################################################################################
##
33-: Sitecore Experience Database (xDB).
A-: The Sitecore xDB collects all your customer interactions from all channel
sources in a real-time.

-Collects interactions data from all channels.


-Stores data for each individual customers, over their entire lifetime.
-Shows you the value of visits and how people are navigating through your
content.
-Powers smart personalization, testing, and optimizing.

34-: Key component of xDb.


A-: Key component of xDb are as follows:

Cd Server -> Session DB -> Collection DB -> Processing Server -> Reporting
DB -> Reporting Service -> Reporting Application

So overall following process happens to the user interaction data:

1> Whenever a user interact with the website, then that data is stored in
the "Session DB(Private, Shared)"
2> Once that session is flushed it get stored in the "Collection DB" in the
Contact, History & Automation" type of a data.
3> The data stored in the "Collection DB" are raw data. So that raw data is
converted into reportable format by "Processing & Aggregation" and
converted and stored into "Reporting DB".
4> Then "Reporting Service" is used to extract the information which can be
displayed on the "Reporting Application".

35-: Types of session used by xDB.


A-: There are 2 types of session used by xDB:

1> Private session state -


- It contains information about contact visit information, such as
pages viewed, goals converted, or campaigns triggered.
- Private session state is 'private' to the browser being used to
access the website.
- If a contact accesses a website simultaneously from their desktop and
mobile phone, each device will have its own private session state.

2> Shared session state -


- Shared session state contains information that is 'shared' across
potentially multiple active sessions.
- This includes any contact information that has been loaded into
tracker at the start of the session.

36-: xDB Collection Database


A-: The xDB Collection database stores analytics data, including contacts and
interactions. So, once that browsing data stored into session and if that data is
flushed it get stored to the "Collection DB".

Now these data are stored using "Sharding" mechanism where 2 different types
of databases are there.

1> Shard database which are used to store contacts, interactions and device
profiles(sitecoreInstanceName__Xdb.Collection.Shared0)

2> Shard map manager database which is used to manage the multiple shard
dbs(sitecoreInstanceName__Xdb.Collection.ShardMapManager)
Experience data is sharded in the following way:

-Contact and interaction data is sharded by contact Identify


-The identifiers index is sharded by identifier
-Device profiles are sharded by device profile ID.

37-: Database sharding.


A-: It is the process of storing a large database across multiple machines.

38-: xDB Reference Data database


A-: The reference Data service and xDB Reference Data database is used to secure
the integrity of data in the Sitecore Experience Database. It is a central store
for data
referenced throughout the Experience Platform processes, such as tracking,
aggregation and reporting.

So to maintain the integrity of the data among all the roles of the sitecore
services like "Reference Data Service", "xDB Processing", "Marketing Automation
Engine",
"Marketing Automation Operations service" are refering to the "xDB Reference
Data database".

39-: xDB Processing Server


A-: The processing and aggregation component extracts information from captured,
raw analytics data and transforms it into a form suitable for use in reporting
applications.
It also performs specific tasks on the collection database that involve mass
updates.

40-: Processing activities performed by the xDB Processing server.


A-: Following are the processing activities that is performed by the xDB
Processing Server:

1> Interaction aggregation


2> Contact processing
3> Rebuilding the reporting database
4> Aggregation

##### INDEXING
###################################################################################
##

00-: Solr installation.


A-: Following are the steps to install Solr:

Step 1: Install Java SDK -


https://www.oracle.com/in/java/technologies/downloads/#jdk19-windows

Step 2: Set Environment variable "JAVA_HOME"(Search Environment Variable in


"System Properties" window). So, we have to add "JAVA_HOME" at 2 places in the
Environment Variable
window. They are:

1> User variable for <window_user>

2> System variables

In both places click on new button and a window (New User


Variable) will open. There you have to add like below:
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk-19 (java path)

Now from command prompt you can chk the java installed version
like below"

C:\Windows\system32> cd C:\Program Files\Java\jdk-19\bin


C:\Program Files\Java\jdk-19\bin>Java - version

Step 3: Download Solr - https://solr.apache.org/downloads.html

Extract downloaded zip folder and paste it wherever you want to


install Solr

Step 4: Run command prompt in admin mode and go to Solr bin path and then
type "solr start" like below

C:\solr-8.11.2\solr-8.11.2\solr start

Default port : 8983

Note: To install Solr at different port run command like below:

C:\solr-8.11.2\solr-8.11.2\solr start -p 8994

Once done will a message like "Started Solr server on port 8994.
Happy searching."

-To stop solr run command "solr stop"

00-: Types of searches in Sitecore.


A-: There are 2 types of searches in Sitecore. They are:

1> Content Search

-Default for Sitecore Experience Manager.


-Content from Master, Web and Core.

2> xContent Search

-Used for Sitecore Experience Platform


-Content from Experience Platform (xDB)

00-: What is Solr?


A-: -Solr is the default search engine for Content Search and xConnect Search for
on-premise installations.
-Microsoft Azure Search is the default search engine for cloud deployments
on Microsoft Azure PaaS
-Use Solr for a scaled environment in on-premise installations, and use Solr
or Azure Search in an Azure environments for a scaled environment

00-: Limitation of Azure Search.


A-: Following are the few limitations of Azure Search:

-If you are using 9.0.1 or lower verion then

>Substring searches that are limited to a single term, for instance,


predicates, .StartWith(), .EndsWith(), and .Contain(), will match parts of
terms, and will match terms that are located in any part of the field
value. When multiple terms are passed, each term is searched separately.
>Regular expressions spanning multiple terms (containing spaces) return 0
results.
>Multiple terms that are passed to .Wildcard() are interpreted as individual
wildcards in a field-scoped query.
>The facet values are calculated based on individual terms in faceted
fields, not on whole field values, when a value contains multiple words.

-If you are using version higher than 9.0.1 then


>An Azure Cognitive Search index can only contains upto 1000 fields.
>.GroupJoin(), .SelfJoin(), and other operators that join queries, is not
supported and results in an error
>Combining range queries with Search using the logical operator OR (||)
produces an error.
>Range queries on string fields always operate on the whole field value
without tokenization and are case-sensitive.
>Does not support same field name but different types in different
documents.

00-: Configure search provider


A-: -Search provider is defined in Web.config file under AppSettings section like
below:

<AppSettings>
<add key="search:define" value="Solr" />
</AppSettings>

-Add connection string (this is done automatic during installation) in


connectionString.config

<add name="solr.search" connectionString="https://localhost:8983/solr" />

-Enable a Search Provider: This setting tells the Sitecore that Solr is
enabled

<setting name="ContentSearch.Provider" value="Solr" />

-Maximum no. of Search Results: maximum no. of documents to retrieve on a


single request.

<setting name="ContentSearch.SearchMaxResults" value="500" />

-Enable Batch Mode: Enable batch mode.

<setting name="ContentSearch.Update.BatchModeEnabled" value="true" />

<setting name="ContentSearch.Update.BatchSize" value="500" />

00-: Index update strategies

1> RebuildAfterFullPublishStrategy

-Rebuild indexes after full publish.


-Subscribes to the OnFullPublishEnd event and it triggers a full index
rebuild.
-Event Queue must be enabled in distributed environment.
-Do not combined with Synchronous Strategy.
2> OnPublishEndAsynchronousStrategy

-Subscribes to the OnPublishEnd event & triggers an incremental index


rebuild.
-Event Queue must be enabled in distributed environment.
-This strategy uses the EventQueue object from the database it was
initialized with and depends on
:This database must be defined
:The EnableEventQueues setting must be true.
:The EventQueue table within the preconfigured database must have
entries that are dated later than the last update timestamp of the index.

3> OnPublishEndAsyncSingleInstance

-It launches an incremental update operation for item modifications as


determined by the event queue
-Triggered by the OnPublishEnd event
-It retrieves the event records only once and reuses them for all indexes it
is attached to.

4> IntervalAsynchronousUpdateStrategy

-Triggered by a time interval


-Uses an internal timer that is initialized with a predefined interval value
-Precondition for using this strategy
:The EnableEventQueues zetting must be true
:The referenced database must be defined in the <databases> configuration
section
:The referenced database must match at least one database that is defined
in a search index to be crawled.

5> SynchronousStrategy

-This strategy is the index update strategy closest to real-time.


-It is also the most expensive strategy in terms of CPU and I/O
-Subscribes to low-level Data Engine events, such as ItemSaved and
ItemSavedRemote

6> RemoteRebuildStrategy

-Subscribes to the OnIndexingEndedRemote event


-Only activated when a full Index rebuild takes place.
-You use this mechanism to rebuild remote indexes when you force an index
rebuild.

7> ManualStrategy

-Must rebuild this index manually. Automatic indexes are disabled.

00-: Configuration files.


A-: To configure above mentioned strategy the config file used is :
Sitecore.ContentSearch.DefaultConfigurations.config

-To understand which index is configured, which strategy is configured then


this file is used to do so :

-for Master index -: Sitecore.ContentSearch.Solr.Index.Master.config

<strategies hint="list:AddStrategy">
<strategy
ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual"
role:require="ContentManagement and !Indexing //>
<strategy
ref="contentSearch/indexConfigurations/indexUpdateStrategies/intervalAsyncMaster"
role:require="Standalone or (ContentManagement and Indexing) //>
</strategies>

-for Web index -: Sitecore.ContentSearch.Solr.Index.Web.config

<strategies hint="list:AddStrategy">
<strategy
ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual"
role:require="(ContentManagement and !Indexing) or (ContentDelivery and !
Indexing) //>
<strategy
ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncSingl
eInstance" role:require="Standalone or (ContentManagement and Indexing) //>
</strategies>

-for Core index -: Sitecore.ContentSearch.Solr.Index.Core.config

<strategies hint="list:AddStrategy">
<strategy
ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual"
role:require="ContentManagement and !Indexing) //>
<strategy
ref="contentSearch/indexConfigurations/indexUpdateStrategies/intervalAsyncCore"
role:require="Standalone or (ContentManagement and Indexing) //>
</strategies>

00-: Best practices while applying indexing strategies.


A-: Below are some best practices recommended by Sitecore while applying indexing
strategies:

-RebuildAfterFullPublishStrategy should not combine this strategy with the


Synchronous Strategy, but you can combine it with any of the other strategies.
Because this
strategy causes a full index rebuild, you must combine it with
SwitchOnRebuildSolrSearchIndex.

-OnPublishEndAsynchronousStrategy should not combine this strategy with any


of these strategies: Synchronous, IntervalAsynchronous and
OnPublishEndAsyncSingleInstance
but can combine it with these strategies: RebuildAfterFullPublish,
RemoteRebuild.

You can use this strategy for multiserver/multi-instance environments,


where you have already enabled the EventQueue.

-OnPublishEndAsyncSingleInstance should not combine this strategy with any


of these strategies: Synchronous, IntervalAsynchronous and OnPublishEndAsync but
can combine
it with these strategies: RebuildAfterFullPublish, RemoteRebuild

You can use this strategy if you have multiple indexes that cover the same
database with published content.

-IntervalAsynchronous should not combine this strategy with these


strategies: SynchronousStrategy, OnPublishEndAsync and
OnPublishEndAsyncSingleInstance but can combine
it with these strategies: RebuildAfterFullPublish, RemoteRebuild.

Use this strategy for the master database indexes and for single-server
environments where you want to use as few resources as possible.

-Synchronous strategy shoulx be used carefully as it can degrade system


performance severely. This can be used on a CM server but not on CD server. This
can be only
combine with RemoteRebuild but not any other.

-RemoteRebuild can be combine with any other strategy. You can then trigger
a full rebuild from one CM server, and all remote servers where the index is
configured
with this strategy will rebuild.

-Manual strategy Do not combine this strategy with any other strategy. It is
reserved for special situations where you have to outsource the whole indexing
process to
a dedicated server and you do not want any index updates on other Sitecore
instances environments where you want to use as few resources as possible.

00-: Indexing tools in Sitecore.


A-: Following are the indexing tools in Sitecore:

>Populate Solr Managed Schema - Solr uses a defined schema when it works
with documents. You can modify an existing schema with the Populate Solr Manager
Schema tool.
This tool automatically populates Sitecore fields and makes sure all fields
that Sitecore needs are present.

>Indexing manager - Indexing Manager provide user interface to rebuild


search index programatically.

00-: Dynamic fields concept.


A-: When Sitecore sends an item to Solr for indexing, the item fields must map to
Solr fields. It is not practicle to manually match large numbers of Sitecore fields
to
Solr fields thus it uses "Dynamic Fields" concept.

So a Dynamic field is just like a regular field except it has name with a
wildcard in it. When you are indexing documents, a field that does not match any
explicitly
defined fields can be matched with a dynamic field.

All mappings are specified in the


"Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config" file.

<fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFildMap,
Sitecore.ContentSearch.SolrProvider>
<typeMatches hint="raw:AddTypeMatch">
...
<typeMatch typeName="guid" type="System.Guid"
fieldNameFormat="{0}_s" />
<typeMatch typeName="string" type="System.String"
fieldNameFormat="{0}_s" />
<typeMatch typeName="text" type="System.String"
fieldNameFormat="{0}_t" />
<typeMatch typeName="int" type="System.Int32"
fieldNameFormat="{0}_tl" />
<typeMatch typeName="bool" type="System.Boolean"
fieldNameFormat="{0}_b" />
<typeMatch typeName="datetime" type="System.DateTime"
fieldNameFormat="{0}_tdt" />
<typeMatch typeName="long" type="System.Int64"
fieldNameFormat="{0}_tl" />
<typeMatch typeName="float" type="System.Single"
fieldNameFormat="{0}_tf" />
<typeMatch typeName="double" type="System.Double"
fieldNameFormat="{0}_td" />
...
</typeMatches>

00-: Sitecore field name mapping example.


A-: Below example shows how sitecore field name are mapped to Solr field name:

-If Sitecore has a field with name "amount" and field type is "number" then
you do not need to map this manually in SOLR.

-Sitecore maps the Sitecore "number" type field to the Solr "float" type
field in the "AddFieldByFieldTypeName" section.

<fieldTypes hint="raw:AddFieldByFieldTypeName">
<fieldType fieldTypeName="number" returnType="float" />
...
</fieldTypes>

-Sitecore replaces the {0} part with the Sitecore "amount" field name to
become the Solr "amount_tf" filed name.
<typeMatches hint="raw:AddTypeMatch">
<typeMatch typeName="float" type="System.Single"
fieldNameFormat="{0}_tf"
settingType="Sitecore.ContentSearch.SolrProvider.SolrSearchFieldConfiguration,
Sitecore.ContentSearch.SolrProvider" />
...
</typeMatches>

-Sitecore indexes the Sitecore "number" type field named "amount" as a Solr
dynamic "float" type field named "amount_tf".

-When Sitecore looks for a filed name, it tries to match the exact name. If
there is no exact match, Sitecore removes any cultural suffixes and Solr dynamic
field

00-: What is Sitecore Computed fields?


A-: Computed fields are fields which stores calculated information while Sitecore
indexes your items. It basically stores calculated or computed values
in the index which physically does not exist in Sitecore.

00-: Steps to create computed fields::

Step 1: Create a class that implements the


"Sitecore.ContentSearch.ComputedFields.IComputedIndexField" interface.

Step 2: Implement simple string properties named "FieldName" and


"ReturnType".
"FieldName" - It is a string type data field which is the name
of the field uses in the index.
"ReturnType - It is a string type data field which refers to the
Solr data type that the Sitecore field type is mapped to within typeMatches.

Step 3: Implement a method called "ComputeFieldValue".

This method accepts an argument that implements the


"Sitecore.ContentSearch.IIndexable" interface and that specifies the data to index.
It
returns an object that represents the value for the field.

public class IsClone : IComputedIndexField


{
public object ComputeFieldValue(IIndexable indexable)
{
Item item = (Item)(indexable as
SitecoreIndexableItem);
return item.IsClone;
}

public string FieldName { get; set; }

public string ReturnType { get; set; }


}

Step 4: In the
"Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config" configuration file,
locate <fields hint="raw:AddComputedIndexField">

Step 5: Add a <field> element to "AddComputedIndexField" and reference your


custom class and assembly within it.

Step 6: Rebuild your search indexes using the Indexing Manager.

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<indexConfigurations>
<defaultSolrIndexConfiguration
type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration,
Sitecore.ContentSearch.SolrProvider">
<documentOptions
type="Sitecore.ContentSearch.DocumentBuilderOptions, Sitecore.ContentSearch">
<fields
hint="raw:AddComputedIndexField">
<field
fieldName="nameOfComputedIndexField" returnType="string">

YourNamespaceHere.ComputedFields.IsClone, YourNamespaceHere
</field>
<sitecore>
</documentOptions>
</defaultSolrIndexConfiguration>
</indexConfigurations>
</contentSearch>
</sitecore>
</configuration>
00-: Index Optimization.
A-:

1> Index only required template and fields.

Check: Sitcore.ContentSearch.Solr.DefaultIndexConfiguration.config

-Turn off indexing of all fields using <indexAllFilds>true</indexAllFilds>,


and include only the fields you need.
-Index only what you intend to search/query.
-Exclude Template : <exclude hint="list:ExcludeTemplate">
-Exclude Field : <exclude hint="list:ExcludeField">
-Index everything for master index so that all items are searchable in the
Content Editor and Index what you need for web index.

<documentOptions
type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions,
Sitecore.ContentSearch.SolrProvider">
<!-- This flag will index all fields by default.This allows new fields
in your template to automatically be included into the index.
You have two choices :

1) Set this to true and place all the fields you would like to
remove in the "ExcludeField" list below.
2) Set this to false and place all the fields you would like to
be indexed in the "IncludeField" list below.
-->
<indexAllFields>true</indexAllFields>

<!-- GLOBALLY EXCLUDE TEMPLATES FROM BEING INDEXED


This setting allows us to exclude items that are based on
specific templates from the index.
Template inheritance will be checked if checkTemplateInheritance
is enabled.
-->
<exclude hint="list:AddExcludedTemplate">

<BucketFolderTemplateId>{F599BF48-D6FE-40DC-9F78-CF2D56BFB657}</BucketFolderTemplat
eId>

<ProductTemplateId>{47D1A39E-3B4B-4428-A9F8-B446256C9581}</ProductTemplateId>
</exclude>

<!-- GLOBALLY EXCLUDE FIELDS FROM BEING INDEXED


This setting allows us to exclude fields from the index when the
indexAllFields setting is true.
-->
<exclude hint="list:AddExcludedField">
<__Created>{F599BF48-D6FE-40DC-9F78-CF2D56BFB657}</__Created>

<__DefaultWorkflow>{47D1A39E-3B4B-4428-A9F8-B446256C9581}</__DefaultWorkflow>
...
</exclude>

2> Index only required content versions

-In Master indexes all the version of the content is getting stored
-You should make sure not more 10 versions of items get created.
-You can use marketplace tools to limit versions.
-Ideally you want to index only the latest version of the item.
-You can index inbound filter pipeline to store only latest version of an
item.
-Configure your index crawlers to include only the portion that it needs to
crawl and index.

namespace MyNamespace
{
public class InboundIndexVersionFilter :
Sitecore.ContentSearch.Pipelines.IndexingFilters.InboundIndexFilterProcessor
{
public override void
Process(Sitecore.ContentSearch.Pipelines.IndexingFilters.InboundIndexFilterArgs
args)
{
var item = args.IndexableToIndex as
Sitecore.ContentSearch.SitecoreIndexableItem;
if (item != null && item.Item != null && !
item.Item.Versions.IsLatestVersion())
{
args.IsExcluded = true;
}
}
}
}

Once the cutomization is done you need to patch it.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<indexing.filterIndex.inbound>
<processor type="MyNamespace.InboundIndexVersionFilter,
MyNamespace" />
</indexing.filterIndex.inbound>
</pipelines>
</sitecore>
</configuration>

3> Index only required content locations - If you never intend to search for
content within a specific location of your content tree (such as templates,
layouts or maybe even media), you can configure your index crawlers to
include only the portion that it needs to crawl and index. Do keep in mind that
if you adopt this approach with your master indexes, the Search
functionality in some of the Sitecore authoring scenarios will not show the
excluded
content – Search tab, Quick Search, Search option in Media Browser dialog
and Copy Presentation Details dialog, etc.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration
type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes>
<index id="sitecore_master_index">
<locations>
<crawler name="content"
type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>master</Database>
<Root>/sitecore/content</Root>
</crawler>
<crawler name="media"
type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>master</Database>
<Root>/sitecore/media library</Root>
</crawler>
</locations>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>

4> Multisite website create seperate indexes per site

-Multisite scenerio you can create an index per site that is configured to
include only the items that belongs to the site content node.
-At the same time, you may also have the default Sitecore indexes which
includes every content in Sitecore by default.
-Crawl the Sitecore node using seperate crawler per index.

<indexes>
<index id="sitecore_web_index_MainWebsite">
<locations hint="lizt:AddCrawler">
<crawler name="mainwebsite"
type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content/Main Website</Root>
</crawler>
</locations>
</index>

<index id="sitecore_web_index_BrandWebsite">
<locations hint="lizt:AddCrawler">
<crawler name="brandwebsite"
type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content/Brand A</Root>
</crawler>
</locations>
</index>
</indexes>

5> You should have index specific to Server Roles

-CMS Server uses master and webpreview databases then corresponding master
and webpreview index should be on the CMS server
-CD server uses web database then it should have only web indexes.

6> Follow best practices related to indexing strategies.

-Master : syncMaster or intervalAsyncMaster


-Web : onPublisbEndAsync
-Core : intervalAsyncCore

7> Keep your indexing pipeline clean and remove unused pipelines.

8> Keep your customizatkon logic minimum and light which includes your
computed fields also.

9> Few settings to play with

-contentSearch.Indexing.DisableDatabaseCaches:

~Indicates whether or not to populate database caches with data retrieved


during indexing.
~If true, Sitecore indexes every version and language of the item as usual
but does not cache this item data in the database caches.
This can reduce the amount of memory used for cached data and improve
performance, especially in solutions with a large no. of items,
versions and languages.
~If false, Sitecore indexes every version and language of the items and
caches the item data in the database caches.
~Default value: false.

-ContentSearch.ParallelIndexing.Enabled: Use parallel optimization when


indexing.

-ContentSearch.ParallelIndexing.MaxThreadLimit: Limit the no. of threads used


for indexing operations when parallel indexing is enabled.

-ContentSearch.IndexUpdate.BatchSize: Determines the no. of items that should


be processed during the index update within a batch.

00-: Solr Query.


A-: This is basically 3 steps process:

Step 1: Get the index which you want to use by using "ContentSearchManager".

ISearchIndex index = ContentSearchManager.GetIndex("sitecore_master_index");

Step 2: Open a connection to search index by using method


"CreateSearchContext" and get the context

using(IProviderSearchContext context = index.CreateSearchContext())


{
//your query
}

Step 3: Last step is to query the index for which you have to use
"GetQueryable<T>"

var results = context.GetQueryable<<SearchResultItem>().Where(x =>


x.Content.Equals("test'));

By default the API will map to the "SearchResultItem" class for the result.

Example1:: Step1: Get the Index


Step2: Open Connection
|
|
using (var context =
ContentSearchManager.GetIndex(indexName).CreateSearchContext())
{
List<SearchResultItem> results =
context.GetQueryable<SearchResultItem>()
.Where(item =>
item.Path.StartWith("/sitecore/content/Home/Products/")
&&
(item.TemplateName == "ProductA")).ToList();
}
|

Step3 :Query the index

Example2::

using (var context = index.CreateSearchContext())


{
var results = context.GetQueryable<SearchResultItem>()
.Where(item => item.TemplateId ==
GlobalId.UniversalContent
|| item.TemplateId ==
GlobalId.UniversalHome)
.Where(item =>
item.Path.Contains("/sitecore/content"))
.GetResults();
}

00-: Predicate Builder for Filtering


A-: Predicate Builder is a powerfull LINQ expression that is mainly used when too
many search filter parameters are used for querying data
by writing dynamic query expression.

using (var context =


ContentSearchManager.GetIndex(ContextItem).CreateSearchContext())
{
var queryable = context.GetQueryable<SearchResultItem>();
}

var predicate = PredicateBuilder.True<SearchResultItem>;

predicate = predicate.And<SearchResultItem>(iTemplateId == [Template ID]);

predicate = predicate.And<SearchResultItem>(iPaths.Contain([Location Item


ID])

predicate = predicate.And<SearchResultItem>(item.Language ==
Context.Language.Name);

Now to filter the data, we can do it in 2 ways:

1st - var result = queryable.where(predicate).Select(i =>


(item)i.GetItem());

2nd - var query =


context.GetQueryable<SearchResultItem>().Filter(predicate);
var results = query.GetResults();

##### CACHING
###################################################################################
##

00-: What do mean by cache? Type of cache.


A-: Caching is the technique of storing the frequently accessed data at a
temporary location for quicker access in the future. This can significantly improve
the performance
of an application by reducing the time required for connecting with the data
source frequently and sending data across the network.

3 different ways to cache. They are:

1> In memory - This store data on the application server memory.

2> Persistent in-process - Your cache outside process memory. It might be in


a file, or in a database.

3> Distributed - This stores data on an external service that multiple


application servers can share.

00-: Caching technique.


A-: Following types of caching technique are available:

1> Page caching - Cache output of the complete page.

2> Partial page caching - Similar to page caching, except that it provides a
mechanism to cache only portions of page.

3> Data caching - Stores the frequently used objects or data.

00-: Server side caching.


A-: Here data is stored either on application server or on seperate server like
cdn server.

Two types of server side caching are there:

1> Object caching - Tbis store data object in cache.

2> CDN caching - This stores pages in multiple cache servers.

00-: Client side caching.


A-: Here data is stored Client machine browser.

Three types of client side caching are there:

1> Browser request - It is built into the HTTP protocol standard

2> JavaScrip/Ajax - Dynamic content in real-time without refreshing the


entire page.

3> Html 5 caching - Cache images, scripts and HTML content.

00-: Different cache layers available in Sitcore.


A-: Whenever a request came to Sitecore then following cashe layers are involved
to serve the request.

HTML -----> Item -----> Data ----->


Prefetch -----> Pull from Database
Is HTML Cashe Is Item Cashe Is Data Cashe
Is Prefetch Cashe
available? available? available?
available?

00-: Initial configuration for Caching in CM and Cd server.


A-:
CM server
CD server

1> Prefetch: 1000 MB 1000


MB

2> Data: 1000 MB 1000


MB

3> Item: 1000 MB 1000


MB

4> HTML: 200 MB

5> AccessResultCache: 200 MB 200


MB

00-: Tuning cache initial values


A-: There are different steps that needs to follow:

Step 1: Set initial cache values before tuining.

Step 2: Start a load test that hits all items in all languages - We have
different tools to do load testing. So we have to test following things here:

Content Delivery - Publish Site

Content Management - Experience Editor & Content Editor

Step 3: Monitor /sitecore/admin/cache.aspx and check below - So we have to


monitor below things here:

Content Delivery-

web[data] (Data cache)

web[item] (Item cache)

SqlDataProvider- Prefetch data(web) (Prefetch cache)

Content Management-

master[data] (Data cache)

master[item] (Item cache)

Step 4: Adjust cache size - Now thumb rule says that:


1> if size of the cache > 80% then
increase the size of cache by 25%
2> if size of the cache < 50% then
decrease the size of cache by 25%
3> if cache delta fluctuates
significantly then increase the size of cache by 25%

Step 5: Repeat the previous step - On a CD server, access to the


administrative pages is normally not available. Sitecore saves a copy of the
cache.aspx
page every ten minutes
in the App_Data\diagnostics\health_monitor folder with names such as

CacheStatus.20230116Z.183005Z.html where "20230116Z.183005Z" is a time stamp.

You can use these


snapshots instead.

A cache is considered
stable when the Delta value remains relatively consistent. Significant fluctuations
in the cache
delta indicates that the
cache is regularly exceeding max size and being scavenged. The maximum amount of
memory that you
can assign to caches
depends on the amount of memory available in the system.

00-: Configure HTML Cache.


A-: To setup HTML cache for the website we have to do it on site definition file.
So here we have to create a patch file and add configuration like below:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site name="website" set:htmlCacheSize="300MB></site>
<site name="customsite" set:htmlCacheSize="300MB></site>
</sites>
</sitecore>
</configuration>

-cacheHtml = true Sitecore clears caches - Sitecore clears cashes and update
it with new values. The publish:end event handler is configured in a standard
installation to
do so.

-preventHtmlCacheClear = true - prevent cache to be cleared when you publish.

00-: Configure Prefetch cache, Item cache and Data cache.


A-: Here we have to create patch configuration file and do the configuration like
below:

-Item cache and Data cache

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/"
xmlns:role="http://www.sitecore.net/xmlconfig/role">
<sitecore>
<databases>
<database id="web" role:require="ContentDelivery or
Standalone">
<cacheSizes>
<data>1000MB</data>
<items>1000MB</items>
</cacheSizes>
</database>
<database id="master" role:require="ContentManagement or
Standalone">
<cacheSizes>
<data>1000MB</data>
<items>1000MB</items>
</cacheSizes>
</database>
</databases>
</sitecore>
</configuration>

-Prefetch cache

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/"
xmlns:role="http://www.sitecore.net/xmlconfig/role">
<sitecore>
<databases>
<database id="web" role:require="ContentDelivery or
Standalone">
<dataProviders>
<dataProvider param1="$(id)">
<prefetch hint="raw:AddPrefetch>
<cache>1000MB</cache>
</prefetch>
<dataProvider>
</dataProviders>
</database>
<database id="master" role:require="ContentManagement or
Standalone">
<dataProviders>
<dataProvider param1="$(id)">
<prefetch hint="raw:AddPrefetch>
<cacheSize>1000MB</cacheSize>
</prefetch>
<dataProvider>
</dataProviders>
</database>
</databases>
</sitecore>
</configuration>

00-: Access Result Cache.


A-: Each time a user accesses an item(or a field), Sitecore resolves and caches
that user's access rights in the Access Result cache. A cache entry consists of a
key
and a value and stores following things:

-The entity(item or field)


-The requested access right (read, write, delete and so on)
-The account that requested the access(user or role)

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/"
xmlns:role="http://www.sitecore.net/xmlconfig/role">
<sitecore role:require="ContentManagement or ContentDelivery or
Standalone">
<settings>
<setting name="Caching.AccessResultCacheSize"
value="200MB">
</settings>
</sitecore>
</configuration>

00-: Disable the cache size limit


A-: If you want to take advantage of available memory then we can disable the
cache size limit.

If cache memory usage exceeds available memory, the application will crash
and throw an OutOfMemoryException exception.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="Caching.DisableCacheSizeLimits"
set:value="true">
</settings>
</sitecore>
</configuration>

00-: Enable Cache Key Indexing.


A-: Cache key indexing can significantly reduce the time it takes to perform
operations on a large cache, and is particularly useful
in large solutions where items are frequently renamed, moved, copied, and
deleted. Cache key indexing is available for the following caches:

✓ Access Result cache


✓ Item cache
✓ Item paths cache
✓ Paths cache

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<settings>
<setting
name="Caching.CacheKeyIndexingEnabled.AccessResultCache" set:value="true">
<setting name="Caching.CacheKeyIndexingEnabled.ItemCache"
set:value="true">
<setting
name="Caching.CacheKeyIndexingEnabled.ItemPathsCache" set:value="true">
<setting name="Caching.CacheKeyIndexingEnabled.PathCache"
set:value="true">
</settings>
</sitecore>
</configuration>

00-: Log singles cache


A-: Sitecore uses the Log singles cache to prevent repeating error message in the
log

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/">>
<sitecore>
<settings>
<setting name="Caching.SmallCacheSize" set:value="200KB">
</settings>
</sitecore>
</configuration>

✓ This cache uses the value of the Caching.SmallCacheSize configuration


setting value to specify the cache size
✓ By default, the setting is not present in the configuration, but you can
add it by patching the configuration. Specify the
value in the <settings> node
✓ The default size is 200 KB
✓ An error message is only logged once, instead of a message being logged
for each request. There is no data loss, as additional
log messages are logged again if the cache no longer contains the same
messages.

00-: Set the QueryStringCache cache size


A-: QueryStringCache cache when Sitecore parses query strings. The default size is
100 KB

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/">>
<sitecore>
<settings>
<setting name="Caching.TinyCacheSize" set:value="100KB">
</settings>
</sitecore>
</configuration>

00-: Caching best practices.


A-:
✓ Do not cache everything in Sitecore this can make website heavy and make
impact publishing performance
✓ Sitecore cache should depend on content so make sure you are clearing
cache after publish
✓ Proper cache tuning should be applied on both Sitecore CM and CD servers
✓ The combined size of caches in configuration cannot exceed the amount of
available system memory

00-: Sample code for caching:


A-:
✓ Creating new cache
var mycache = new Sitecore.Caching.Cache("test", 1024);

✓ Referencing the Cache


var mycache = Sitecore.Caching.CacheManager.FindCacheByName("test");

✓ Adding a Value to the Cache


var mycache = Sitecore.Caching.CacheManager.FindCacheByName("test");
mycache.Add("name", "value");

✓ Reading a Value from the Cache


var mycache = Sitecore.Caching.CacheManager.FindCacheByName("test");
var value = mycache.GetValue("name");

✓ Removing a Value from the Cache


var mycache = Sitecore.Caching.CacheManager.FindCacheByName("test");
mycache.Remove("name");

✓ Clearing the Cache


var mycache = Sitecore.Caching.CacheManager.FindCacheByName("test");
mycache.Clear();

##### Dependency Injection


###################################################################################
##

00-: What is dependency injection (DI)? What is its use?


A-: Dependency injection(DI) is a software design pattern that allows us to
develop loosely coupled code.
It is a process of supplying the required resources to the code which
requires these resoures.
DI allow developers to build loosely coupled components as we make our
components depended upon the Interfaces rather than depending
on the actual implementation.
It is instead of using direct & hard-coded intances we inject dependencies
to the components and make them aware that they will need injected
dependency to serve the purpose.

00-: Types of dependency injection (DI).


A-: There are three types of dependency injection:

1> Constructor DI - Here the dependency is supplied through the class's


constructor when creating the instance of that class means the dependency
is injected via the class.
The injected component can be used anywhere in
the class.
Also it is recommended to use when the
injected dependency you are using across the class methods.

2> Method DI - In this case inject the dependency into a single method and
generally for the use of that method.
It could be useful where whole class does not need
the dependency and only one method having the dependency.

3> Property DI - In this case inject the dependency into a single method and
generally for the use of that method.
It is recommended using when a class has optional
dependencies or where the implementations may need to be swapped.
Does not require the creation of a new object or
modifying the existing one without changing the object state it could work.

00-: Why to use dependency injection(DI)?


A-:
1> Quick fixes and easy new feature implementation due to loose coupling.

2> Because of the externally injected dependencies, developers can scale up


the application without worrying about managing dependencies manually
for each functionality.

3> You can use mock databases with dependency injection, and test your
application without affecting the actual database.

4> Easy to implement more modularized code and promote reusability without
any code changes.
5> Highly maintainable code.

00-: What is DI container?


A-: DI container that is also known as the IoC container is a framework for
implementing automatic dependency injection very effectily. It manages
the complete object creation and its lifetime, as well as it also injects
the dependencies into the classes.

It has three steps:

Step 1: Register - The container should be registered or initiated as soon


as it gets the specific type and this is called the register stage.

Step 2: Resolve - The DI container must include some of the methods to


resolve the specified type as soon as it identifies. The respective container
creates an object of the specified type, along
with injecting the required dependdencies if any of them are required, and at last,
it returns the object.

Step 3: Dispose - The DI container must be able to manage the lifetime of


the dependent objects accordingly. Most of the DI containers include different
lifetime managers and their responsibility for
managing an object's lifecycle and disposing of it.

00-: Which are the 2 namespaces which is responsible for DI?


A-: Microsoft.Extensions.DependencyInjection;
Sitecore.DependencyInjection;

00-: Methods to define the scope of the service that is going to create.
A-: Below are the methods that is used to define the scope of the service:

1> AddTransient - The services are created each time they're requested. It
means on every request a new object is created.

2> AddScoped - The services are created once per client request. It means an
object is created once for each user.

3> AddSingleton - The services are created for the first time they are
reqursted and then every subsequent request will use the same.

00-: Steps to apply DI in Sitecore.


A-: Below are the steps to apply DI in Sitecore:

Step 1: Create a register dependency class and for that we have to add 2
namespaces mentioned below:

Microsoft.Extensions.DependencyInjection;
Sitecore.DependencyInjection;

Step 2: Then we have to inherit interface "IServicesConfigurator" to the


register class

public class RegisterDependencies : IServicesConfigurator

Step 3: Next in the "Configure" method of that "RegisterDependencies" class,


pass "IServiceCollection" parameter to the method.

public void Confiure(IServiceCollection serviceCollection)


Step 4: Then you can define the dependencies in this "Configure" method. So
here 2 things we have to do:

1st> Map the interface (for ex. 'ISampleCompManager') which we


are using for the service (for ex. 'DisplayDataService')

2nd> Also have to give the dependency of the controller (for ex.
'SampleCompController').

So over all code should be like below.

public class RegisterDependencies : IServicesConfigurator


{
public void Confiure(IServiceCollection serviceCollection)
{

serviceCollection.AddTransient(typeof(ISampleCompManager),
typeof(DisplayDataService));

serviceCollection.AddTransient(typeof(SampleCompController));
}
}

Step 5: Next we have to register the Service Configurator via config file
like below:

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<services>
<configurator
type="SitecoreWithDI.Feature.SampleComp.Configurators.RegisterDependencies,,
SitecoreWithDI.Feature.SampleComp" />
</services>
</sitecore>
</configuration>

00-: What is webhooks?


A-: Webhooks are user-defined HTTP callbacks triggered by specific events. So
Sitecore also introduce webhooks for the workflows and now with
the help of this we can have real-time notifications about events or
workflow actions that occur in XM. Also whenever item workflow state changes
there is a webhooks to run external validation.

There are three types of Webhooks supported by v10.3.0

1> Event handler - You can receive information about supported system
events. Ex- Event handler to send a request to a specified URL when an item
with the webpage templated is created.

2> Submit action - You can receive information when an item changes workflow
state or when a workflow command runs. Ex- Webhook when an item using
the workflow moves to the approved state.

3> Validation action - You can provide a third-party service the ability to
approve or reject changes in the workflow state of an item, by creating
a webhook validation action. When a
webhook validation action sends a request, third-party service must return a
response.

##### Personalization
###################################################################################
##

00-: What is Personalization in Sitecore?


A-: Personalization in web content management refers to the practice of tailoring
website content and user experiences to meet the specific needs, preferences,
and behaviors of individual users.

The goal is to deliver more relevant and engaging content to each visitor,
thereby enhancing their overall experience and increasing the likelihood of
achieving desired outcomes, such as convirsions or customer satisfaction.

Personalization is the act of tailoring an experience or communication based


of information a company has learned about an individual.

00-: Various types of informaition to act upon.


A-: Following are few of the types of informaition which can be utilized for
personalization:

-Geolocation : location of the user


-Source(such as search, email, social, paid ad, referring site, etc.)
-Firmographic informaition for B2B(such as industry, company, revenue,
employee count, technology stack, etc.)
-Buyer persona
-Buyer status(e.g customer or prospects)
-Time of day
-Browser of device type
-Number of site visits, logins, or pages/screens viewed
-Active time spent.
-Time elapsed since last visit, email open, call center, interaction, etc.
-Purchase made, articles read, videos viewed, etc.
-Mouse movement(scrolling, hovering, inactivity, etc.)
-Affinity towards content and products along with their
characteristics(categories, tags, brands, color, keywords etc.)
-Email opens and clicks.
-Push notification dismissals or click through.

00-: Personalization vs Customization


A-:
Personalization
Customization
-Tailoring to individual needs based on data and behavior
-Allowing users to manually modify preferences
-Dynamic adjustments based on data and algorithms
-Static adjustments based on user input
-Often involves automated algorithms and machine learning
-Relies on user input for manual adjustments
-Enhanced user engagement, increased satisfaction
-User empowerment, a sense of ownership
-Example - Depending on user history, location, persona etc.
-Example - User apply filters on his own based
more relevant products are displayed on front as recommendation on his
need and filtered products

00-: Types of Personalization.


A-: Following chart will give detail about Sitecore Personalization:
_______________

Personalization

___________
______________________
Experiences
Data-gathering methods

(Based Customer experience on the channel)


(Based on customer data on the website)

________________________ ____________________
________________ ________________
Interruptive experiences Seamless experiences
Explicit Website Implicit Website

(A person doesn't expect (An integral part of


(A website experience (A website experience
from a brand and aren't the experience you
is customized according is customized according
even integral to their offer to a visitor)
to the criteria set by to context and behavior)
current website experience)
the visitors themselves)

______________

Behavior-Based

(Based on the relationship between

a customer's browsing history and a

website's content)

__________

Contextual
(Personalizes the experience of a visitor

based on the context in whicFull screen

they're browsing your site)

00-: Example of Personalization.


A-: Examples of personalization as follows:

1. Interruptive experiences - Pop-ups, infobars, and push notifications


along with web or mobile app messages

2. Seamless experiences - After a purchase, the platform sends personalized


order confirmation emails and follows up with tailored recommendations
for complementary products or
accessories.

3. Explicit Website Personalization - Visitors choose their preference on


website like my location, my gender, etc. This helps a website to show
products/services
which are most relevant to the visitors rather than furnishing their entire list of
offerings

4. Implicit Website Personalization Behavior-Based - Social media accounts,


you get recommendations of profile based on your behavior on the website

5. Implicit Website Personalization Contextual Personalization - Displaying


nearest Hotels or Petrol pump based on your current location.

00-: Types of Personalization based on Implementation


A-: Based on Implementation following type of Personalization is there:

1. Rule Based Personalization

✓ It allows you to manually create preset rules that determine what


experience each segment of your audience gets.
✓ Rule-based personalization can be applied to both broad audience
segments (wide groups of web visitors) and narrow ones (small groups of web
visitors).
✓ Example: Local news headlines take priority for users in a specific
region

2. Machine-Learning Personalization

✓ It uses algorithms to give a one-on-one personalized web experience.


It does this by actively collecting data and analyzing them in real- time. With
this, it can predict what a web visitor needs per time.
✓ It is becoming more popular among many brands because it's more
scalable. It can be used to personalize product or content recommendations, search
results, ad campaigns, etc.
✓ Example: Predicting search keyword based on user search history and
browsing history

00-: Personalization implementation process


A-:
Visitor data collection Create visitor personas and journey
Set your goals Prepare strategy Plan
implementation
----------------------- -----------------------------------
-------------- ---------------- ------------
-------
• Ask the visitors directly • Identify different visitor persona
• Increasing Conversion • Optimize Home Page • Identify use
cases
• Map customer journey • Identify different user path and
• Reducing bounce rate • Identify key and most • Prioritize
• Cookies and web beacons their journey on the website
• Increase leads visited pages • Set Up
• Company records and social
• Increasing retention • Identify personalization
• Test and Analyze result
media
• Increase Orders scenarios for key
pages • Repeat
• Email activity tracking
• Increase registration like products, cart etc.
• External data sources
• Repeat purchase • Improved search result


Provide alternate option

on no
search result page

✓ Create quizzes ✓ Teenage Female


✓ Get Feedback from visitor ✓ Teenage Male
✓ Create surveys ✓ Young Male
✓ Add contact forms ✓ Young Female
✓ Old Female
✓ Old Male

>Segmentation - Segmentation is the process of dividing a target audience


into distinct groups based on shared characteristics, allowing businesses
to tailor their marketing strategies and products to better meet the specific
needs of each group

>A/B Testing - A/B testing, or split testing, is a method in which two


versions (A and B) of a webpage, app, or marketing element are compared to
determine which performs better based on specific metrics

>Geotargeting - Geotargeting allows you to deliver content, product


recommendations, etc. to your web visitors based on their geographic location

00-: How to implement Personalization on website?


A-:
##### Content Serialization
###################################################################################
#######

00-: XM(Sitecore Experience Manager) vs XP(Sitecore Experience Platform) vs XM


Cloud
A-: XM(Sitecore Experience Manager) - Sitecore's CMS only offering
- Multiple website,
Mutilingual website manage in the same CMS
- Deliver content across
multiple devices and channels
- Experience editor
- Personalize a user's
experience only based on their current visit.
- Forms, Publishing
service, SXA(Sitecore Experience Accelerator), Search, Active Directory

XP(Sitecore Experience Platform) - All feature of Sitecore XM


- Personalization and
Marketing Automation
- Tracks user's action and
experiences over multiple sessions
- Sitecore AI, Sitcore
Corte, Sitecore xDB, Sitecore Experience profile
- Sitecore JavaScript
Services(JSS)
- Experience Analytics
- Sitecore xConnect
- Salesforce Connectors

XM Cloud - It is a SaaS solution


- It is a 100% headless solution
- 100% seperation between your front-end and back-end.

00-: XM Cloud
A-: -SaaS based solution.
-Upgrade will be done by Sitecore.
-Infrastructure management and maintenance, security maintenance, and
scalability will be managed by Sitecore.
-It does not have CDs at all but only serves content via highly available
Edge APIs.
-Reduces bottleneck of Sitecore developers availability.
-Cloud portal: Dashboard of the organization. Based on your subscription all
tools will be at one place.
-Sitecore Experience Edge is a content delivery service that provides
scalable, globally replicated access to Sitecore Experience Platform
items, layout and media through an API. It uses CDN networks to distribute
published content across the globe, ensuring a fast experience at scale.
-GraphQL schema is used to query the content.
-Custom search indexes are no longer available and one has to select from a
choice of composable options: Sitecore search, Coveo or Algolia.
-A cut version of Sitecore Personalize comes built into Pages interface of
XM Cloud to allow for basic view event personalization.
-Boxever page-level analytics tool is embeded.

00-: Feature not available in XM Cloud.


A-: -XP/xConnect/xDB functionality including existing personalization rules (a new
embeded personalization experience is available for XM cloud).
-Marketing applications, including Experience analytics, Experience Profile,
FXM, Experience Optimization, List Manager, Campaign Creator, Path Analyzer,
Marketing Automation and the Marketing Control Panel.
-Emal Experience Manager(EXM)
-SXA with MVC and SXA Search Components
-Sitecore Forms, Custom Search Indexes, Identity server, Sitecore Publishing
Service, Universal Tracker, Device detection, IP Geolocation, MVC, The Update
Center
-Roles: Content Delivery, Content Publishing, Forms Database, Web Index,
Sitecore Identity Server, Device Detection, IP Geolocation

00-: When to use what?


A-: Parameter to find out best product:
>On-premise vs SaaS vs Paas
>Headless vs Coupled
>Future vision
>Resource Capacity - Development, Hosting
>Markating Automation and personalization
>Jamstack Approach

00-: XConnect new export tool


A-: New data export tool to export contacts into files which support both Azure
Blob & File Storage.

00-: Database encryption


A-: Transparent Data Encryption can be applied to protect critical data by using
data-at-rest encryption.

00-: Sitecore Client


A-: It now supports Linux-based environments and features publishing to edge.

00-: Identify database


A-: This new feature helps us to identify which database raised a publish:end and
publish:end:remote event.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy