Posts

Showing posts from November, 2014

Convert item to bucket item programmatically

Item buckets lets you store millions of items in a repository without having a direct parent-child relationship, which solves the problem of having large number of items in content tree.

Any item in sitecore can be converted into item bucket from Content Editor, by going to 'Configure' tab then clicking 'Bucket' to convert the item into item bucket.

I was able to write some helper methods to conver item to Item bucket programmatically , in case you were importing large number of data and you wanted to covert items into buckets on the fly.

public static void ConvertToBucketItem(Item item)     {         using (new SecurityDisabler())         {               Sitecore.Buckets.Managers.BucketManager.CreateBucket(item);             using (new Sitecore.Data.Items.EditContext(item, SecurityCheck.Disable))             {                 if (!IsBucketItemCheck(item))                 {                     IsBucketItemCheckBox(item).Checked = true;                 }            …

Integrating Lucene.Net.Contrib.Spatial with Sitecore Search API (Geo-Spatial Search)

Image
Note: Newer release is published on github that support sitecore 8.1 & 8.2 and fixes the issue with location results being cached, Go to this post to read about the details of the new release

I have created an Extension to Sitecore.ContentSearch API which uses Lucene.Net.Contrib.Spatial library to generate spatial queries.


Currently, i added a method "WithinRadius()" to retrieve locations within specific radius (In miles) of center point , the results will be sorted based the distance from the center point.

This extension assumes that you have Latitude and Longitude stored as fields in your location items.

Installation:
 You can either get the source from github or install nuget package.

Marketplace:
Go to Sitecore Marketplace and download "Lucene Spatial Search Support" package.Install the package using Sitecore Installer wizardConfigurations:
Go to 'Sitecore.ContentSearch.Spatial.config' file in your include folder, you will need to add your location temp…