1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Create search index for a selected blog

Create search index for a selected blog

2 posts, 0 answered
  1. vipul patel
    vipul patel avatar
    37 posts
    Registered:
    12 Mar 2010
    25 Jun 2010
    Link to this post
    Hi,

    Is it possible to create a search index for a specific blog rather than all the blogs?  if yes please let me know how to do it.

    Thanks,

    Vipul Patel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Jun 2010
    Link to this post
    Hello vipul patel,

    There is no setting in Sitefinity's UI that you can use. You should create a custom index provider that inherits from BlogIndexProvider and override ParentIDs. Then return the desired blog ID. Below is a sample code

    using System;
    using Telerik.Blogs;
      
    /// <summary>
    /// Summary description for SingleBlogProvider
    /// </summary>
    public class SingleBlogProvider : BlogIndexProvider
    {
        public SingleBlogProvider()
        {
        }
      
        public override string Description
        {
            get { return "single blog index"; }
        }
      
      
        public override string Name
        {
            get { return "IndexSingleBlog"; }
        }
      
        public override Guid[] ParentIDs
        {
            get
            {    
                // this is the guid for your blog.
                return new Guid[]{ new Guid("EBBE920D-32BA-45fa-B2AE-46558A76F4E3")};
            }
        }
      
    }



    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered