Im using Sitecore 7 and the search provider Solr. Currently, I have a site setup to update the search index when publishing an item.
Ive noticed that when a CMS author creates different versions of an element and then submits them to the index, the previous version of the element is not removed from the index, so the index contains several versions of the same Sitecore element.
Does anyone know of any settings that I can change to make sure the previous version is removed from the index before adding the new version?
Ive tried to run some code, as shown below, to remove items from the index immediately before publishing, but the Delete method in the index does not delete anything.
var indexableItem = (SitecoreIndexableItem)item; ContentSearchManager.GetIndex(index).Delete(indexableItem.UniqueId
Any help is greatly appreciated.
c # solr sitecore sitecore7
Ian graham
source share