Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1461 posts 1883 karma points
    Sep 02, 2024 @ 14:58
    Gordon Saxby
    0

    Make External index store Protected Content

    Umbraco 13

    I want to make the standard "External" index store protected content, so I have added this class. It seems to work but it shows the "new ContentValueSetValidator" call as Obsolete. What can I change it to?

    public class ConfigureExternalExamineIndexOptions : IConfigureNamedOptions<LuceneDirectoryIndexOptions>
    {
        private readonly IPublicAccessService _publicAccessService;
    
        public ConfigureExternalExamineIndexOptions(
            IPublicAccessService publicAccessService
            )
        {
            _publicAccessService = publicAccessService;
        }
        public void Configure(string? name, LuceneDirectoryIndexOptions options)
        {
            if (name.Equals(Constants.UmbracoIndexes.ExternalIndexName))
            {
                options.Validator = new ContentValueSetValidator(true, true, _publicAccessService, null, null, null);
    
                options.FieldDefinitions.AddOrUpdate(new Examine.FieldDefinition(AppConstants.News.DateSearchableField, FieldDefinitionTypes.DateTime));
                options.FieldDefinitions.AddOrUpdate(new FieldDefinition(AppConstants.CommonSearchFields.SortContentUpdateDate, FieldDefinitionTypes.Long));
            }
        }
    
        public void Configure(LuceneDirectoryIndexOptions options)
        {
            throw new NotImplementedException();
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft