Task IContentPartIndexHandler.BuildIndexAsync(ContentPart contentPart, ContentTypePartDefinition typePartDefinition, BuildIndexContext context, ContentIndexSettings settings)
        {
            var part = contentPart as TPart;

            if (part == null)
            {
                return(Task.CompletedTask);
            }

            var buildPartIndexContext = new BuildPartIndexContext(context.DocumentIndex, context.ContentItem, typePartDefinition.Name, typePartDefinition, settings);

            return(BuildIndexAsync(part, buildPartIndexContext));
        }
        Task IContentPartIndexHandler.BuildIndexAsync(ContentPart contentPart, ContentTypePartDefinition typePartDefinition, BuildIndexContext context, ContentIndexSettings settings)
        {
            var part = contentPart as TPart;

            if (part == null)
            {
                return(Task.CompletedTask);
            }

            var keys = new List <string>();

            keys.Add(typePartDefinition.Name);
            foreach (var key in context.Keys)
            {
                keys.Add($"{key}.{typePartDefinition.Name}");
            }

            var buildPartIndexContext = new BuildPartIndexContext(context.DocumentIndex, context.ContentItem, keys, typePartDefinition, settings);

            return(BuildIndexAsync(part, buildPartIndexContext));
        }
 public abstract Task BuildIndexAsync(TPart part, BuildPartIndexContext context);