private static void IndexProduct(FindHelper helper, IIndexableContent p) { if (p.ShouldIndex()) { var currentMarket = ServiceLocator.Current.GetInstance <Mediachase.Commerce.ICurrentMarket>().GetCurrentMarket(); FindProduct findProduct = p.GetFindProduct(currentMarket); if (findProduct != null) { IClient client = SearchClient.Instance; client.Index(findProduct); } } else { //TODO: remove product from index //IClient client = SearchClient.Instance; //var lang = p.Language; //client.Delete<FindProduct>(productContent.ContentLink.ID + "_" + (lang == null ? string.Empty : lang.Name)); } }
protected void IndexProduct(IIndexableContent p) { if (p.ShouldIndex()) { var currentMarket = ServiceLocator.Current.GetInstance<Mediachase.Commerce.ICurrentMarket>().GetCurrentMarket(); FindProduct findProduct = p.GetFindProduct(currentMarket); if (findProduct != null) { _log.Debug("Indexing {0} - {1}", findProduct.Code, findProduct.Name); IClient client = SearchClient.Instance; client.Index(findProduct); } } else { //TODO: remove product from index _log.Debug("TODO: Remove from index {0}", p.Name); //IClient client = SearchClient.Instance; //var lang = p.Language; //client.Delete<FindProduct>(productContent.ContentLink.ID + "_" + (lang == null ? string.Empty : lang.Name)); } }
protected void IndexProduct(IIndexableContent p) { if (p.ShouldIndex()) { var currentMarket = ServiceLocator.Current.GetInstance <Mediachase.Commerce.ICurrentMarket>().GetCurrentMarket(); FindProduct findProduct = p.GetFindProduct(currentMarket); if (findProduct != null) { _log.Debug("Indexing {0} - {1}", findProduct.Code, findProduct.Name); IClient client = SearchClient.Instance; client.Index(findProduct); } } else { //TODO: remove product from index _log.Debug("TODO: Remove from index {0}", p.Name); //IClient client = SearchClient.Instance; //var lang = p.Language; //client.Delete<FindProduct>(productContent.ContentLink.ID + "_" + (lang == null ? string.Empty : lang.Name)); } }
private static void IndexProduct(FindHelper helper, IIndexableContent p) { if (p.ShouldIndex()) { var currentMarket = ServiceLocator.Current.GetInstance<Mediachase.Commerce.ICurrentMarket>().GetCurrentMarket(); FindProduct findProduct = p.GetFindProduct(currentMarket); if (findProduct != null) { IClient client = SearchClient.Instance; client.Index(findProduct); } } else { //TODO: remove product from index //IClient client = SearchClient.Instance; //var lang = p.Language; //client.Delete<FindProduct>(productContent.ContentLink.ID + "_" + (lang == null ? string.Empty : lang.Name)); } }