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

Forums / Developing with Sitefinity / Search Indexing For Videos

Search Indexing For Videos

2 posts, 0 answered
  1. Michael
    Michael avatar
    3 posts
    Registered:
    28 Sep 2011
    13 Oct 2011
    Link to this post
    Hi,

    I'm trying to add a search index for video content and am running into a wall. I though that perhaps videos would be indexed with the builtin contentitems but that does not seem to be the case.

    I tried the quick and dirty method from this blog post but when I add the line to register the template pipe and attempt to create a new index I'm receiving the following error:

    'Could not find the specified key "VideosSearchInboundPipe" or class id "PublishingMessages"'

    My inbound pipe is just a skeleton class at this point in an attempt to get this started:
    class VideosSearchInboundPipe : ContentInboundPipe
    {
        public static readonly string PipeName = "VideosSearchInboundPipe";
     
        public static PipeSettings DefaultPipeInboundSettings
        {
            get
            {
                SitefinityContentPipeSettings ps = (SitefinityContentPipeSettings)PublishingSystemFactory.GetPipeSettings(ContentInboundPipe.PipeName);
                ps.ContentTypeName = typeof(Video).FullName;
                ps.MaxItems = 0;
                ps.UIName = "VideosSearchInboundPipe";
                ps.PipeName = "VideosSearchInboundPipe";
                //ps.ResourceClassId = typeof(CCG.ContentTypes.Experts.ExpertsResources).Name;
                return ps;
            }
        }
        public static PipeSettings DefaultPipeOutboundSettings
        {
            get
            {
                var pipeSettings = PublishingSystemFactory.GetPipeSettings(VideosSearchInboundPipe.PipeName);
                return pipeSettings;
            }
        }
    }

    And here is the code I'm using to register the pipe:
    PublishingSystemFactory.RegisterPipeSettings(VideosSearchInboundPipe.PipeName, VideosSearchInboundPipe.DefaultPipeInboundSettings);
    //PublishingSystemFactory.RegisterPipeMappings(VideoSearchInboundPipe.PipeName, true, VideoSearchInboundPipe.DefaultPipeMappings);
    //PublishingSystemFactory.RegisterPipeDefinitions(VideoSearchInboundPipe.PipeName, VideoSearchInboundPipe.DefaultPipeDefinitions);
    PublishingSystemFactory.RegisterPipe(VideosSearchInboundPipe.PipeName, typeof(VideosSearchInboundPipe));
    PublishingSystemFactory.RegisterTemplatePipe("SearchItemTemplate", VideosSearchInboundPipe.DefaultPipeOutboundSettings, ps => ps.PipeName == VideosSearchInboundPipe.PipeName);

    And help would be greatly appreciated. Thanks.


    Michael
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Oct 2011
    Link to this post
    Hi Michael,

    Registering the new pipe will work when you create new indexes. For example, create a Global.asax file and put the bellow code (that is if you are not adding the code to the Initialize event of a custom module):
    protected void Application_Start(object sender, EventArgs e)
    {
        Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
    }
      
    void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
    {
        if (e.CommandName == "Bootstrapped")
        {
            var pipeSettings = (SitefinityContentPipeSettings)PublishingSystemFactory.GetPipeSettings(ContentInboundPipe.PipeName);
            pipeSettings.ContentTypeName = typeof(Video).FullName;
            pipeSettings.MaxItems = 0;
            PublishingSystemFactory.RegisterTemplatePipe("SearchItemTemplate", pipeSettings);
        }
    }

    After the website is restarted and you go in to create a new index you will see the result as in the attached image.

    Best wishes,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested 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