/
DFO 3.1.0 - 9 Indexing Assets with Optimizely Find

DFO 3.1.0 - 9 Indexing Assets with Optimizely Find


DAM for Optimizely works well with Optimizely Find. To get the most out of it you might want to even add the individual assets to the index. This can be done by adding a ReindexInformation provider as shown below.

ReindexInformation Provider
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.Find.Cms;
using EPiServer.ServiceLocation;
using EPiServer.Web;

namespace Digizuite.Episerver.Examples.Find
{
    [ServiceConfiguration(typeof(IReindexInformation), Lifecycle = ServiceInstanceScope.Singleton)]
    public class DigizuiteReindexInformation : IReindexInformation
    {
        public IContentLoader ContentLoader { get; set; }

        public IDigizuiteClient Client { get; set; }

        public DigizuiteReindexInformation(IContentLoader contentloader, IDigizuiteClient client)
        {
            this.ContentLoader = contentloader;
            this.Client = client;
        }

        public virtual IEnumerable<ReindexTarget> ReindexTargets
        {
            get
            {
                if (Client.Folders == null)
                    return new List<ReindexTarget>();

                var contentLinks = new List<ContentReference>();
                var languages = Client.Languages.Select(lang => new CultureInfo(lang.LanguageShort)).ToList();

                var entrypoint = DigizuiteContentProvider.GetEntryPoint();
                var childrens = ContentLoader.GetDescendents(entrypoint);
                contentLinks.AddRange(childrens);

                return new List<ReindexTarget>()
                {
                    new ReindexTarget
                    {
                        ContentLinks = contentLinks,
                        Languages = languages,
                        SiteDefinition = SiteDefinition.Empty
                    }
                };
            }
        }

        public virtual ContentReference Root
        {
            get
            {
                var entrypoint = DigizuiteContentProvider.GetEntryPoint();
                return entrypoint;
            }
        }
    }
}

Related content

DFO 3.1.0 - 8 Customizing Asset Urls
DFO 3.1.0 - 8 Customizing Asset Urls
Read with this
DFO 3.2.0 - 9 Indexing Assets with Optimizely Find
DFO 3.2.0 - 9 Indexing Assets with Optimizely Find
More like this
DFO 3.1.0 - 16 Video playback
DFO 3.1.0 - 16 Video playback
Read with this
DFO 3.0.0 - 9 Indexing Assets with Optimizely Find
DFO 3.0.0 - 9 Indexing Assets with Optimizely Find
More like this
DFO 3.1.0 - 3 Setting up Optimizely
DFO 3.1.0 - 3 Setting up Optimizely
Read with this
DFE 1.0.0 - 9 Indexing Assets with Episerver Find
DFE 1.0.0 - 9 Indexing Assets with Episerver Find
More like this