Skip to main content

The strange behavior of Sitecore Search with cloned items

Today I would like to share some strange behavior noticed when using Sitecore search with cloned items. Sitecore support was also able to reproduce this.
I tested it using Lucene and Azure searches, and both of them displayed the same behavior.
I will update this post when I get an update from Sitecore Support.

Context

We have a multi-site solution where some types of items can be shared with other sites using item cloning features.
eg The editor creates a news item on the first site, they can then clone this news item to any other site. If the editor wants to edit the news item, they need only edit the original item and any changes will be reflected the clones immediately.

 Let's assume, we have the following structure within Sitecore:
We have the following index configuration for the "Global Site", called global_site_master_index

After an index rebuild, global_site_master_index contains items from the Global Site.

Let's clone FirstSite_News to the Second Site's news folder and update one of the fields from the FirstSite_News item

Reopen index in Luke, and you will see the cloned item has been indexed in the global_site_master index.


You can check out a short video about this issue here

Workaround

Let's create a custom SitecoreItemCrawler where you can exclude an item if it is a clone.  Please note, this will exclude all of the cloned items.


Update your search config, crawler section.  
another possible workaround:

Comments

Post a Comment

Popular posts from this blog

Sitecore 8.1 upgrade from 7.2

In the following post, I would like to share my experiences with regard to Sitecore upgrading and highlight some points. We have a project which is running on Sitecore 7.2 update 4. (This project was originally developed on Sitecore 6.5, but we upgraded it a few months ago) We have decided to upgrade that project to 8.1.  Probably you know there are more ways to move a project to Sitecore 8. e.g: You can create a new Sitecore 8 instance and transfer your content into the new instance. But we wanted to try the in-place upgrade process when the process modifies the existing instance. Moreover, we were curious how we can move old DMS data to xDB.  Step 1: Upgrade to 7.5 (Initial release) If you are already on Sitecore 7.2 you can move your solution to 7.5. Probably this is the hardest and slowest part of the path. Note: Always read and follow the upgrade notes from Sitecore before you start.  Before you start 7.5 upgrade, you will need: 7.5 update package (initial release)

Create custom Sitecore Search Crawler

Hello, I would like to show an implementation of a custom crawler which prevents indexing items under specific paths. This is useful when you want to exclude a whole subtree from your index configurations. e.g: You have a multi-site structure which contains 3 sites. You want to implement search funcationlity on one of the sites (call site A) and visitors should be able to search in site B content, but content from site C should not be visible, and you dont want to break relevancy of the search result. The first step is create a class, call CustomCrawler.cs. This class should be derived from SitecoreItemCrawler class. Now, you can overwrite IsExcludedFromIndex method. If you are ready, you should change crawler in the search config. Add paths to ExcludeRoot node and seperate them by pipes. That's all. Now items are not indexed from the excluded paths, and you don't break the relevancy.

Sitecore SPEAK 3 UI collection

Hi, I would like to present my Sitecore SPEAK 3 UI library to you in the hope it will be a helpful template. Please check out a previous Sitecore SPEAK3 related post here . I've created a SPEAK 3 application, in which several SPEAK 3 components and styling are collected. You can download it from GitHub and check what different sitecore/angular components look like and check predefined styles, etc Moreover, I am calling on you all to contribute, because SPEAK 3 is really awesome, and it is quite fun even if you have never used Angular 4 before. How to use the sample code 1) Clone this repository . 2) Run 'npm install ' command in the project directory 3) Run ' npm run start ' command in the project directory 4) Open http://localhost:4123 in your browser How to use directives/components in your SPEAK3 application In this example we are going to add the  BackButton ,  Tabs  component and Table  directive to our application.  1) Make sure if the  @speak