Matthew Alexandros
08/17/2024, 8:44 PMJemayn
08/18/2024, 8:40 PMcsharp
public class ExamineComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.Services.AddSingleton<IUmbracoIndexConfig, ContentIndexConfig>();
    }
}
And then you can add your own where you fx exclude a few fields from the internal index:
csharp
public class ContentIndexConfig : IUmbracoIndexConfig
{
    private readonly IPublicAccessService _publicAccessService;
    private readonly IScopeProvider _scopeProvider;
    public ContentIndexConfig(
        IPublicAccessService publicAccessService,
        IScopeProvider scopeProvider
    )
    {
        _publicAccessService = publicAccessService;
        _scopeProvider = scopeProvider;
    }
    // The internal index
    public IContentValueSetValidator GetContentValueSetValidator()
    {
        IEnumerable<string> excludeFields = ["field1", "field2"];
        return new ContentValueSetValidator(
            false,
            true,
            _publicAccessService,
            _scopeProvider,
            null,
            null,
            null,
            null,
            excludeFields
        );
    }
    public IContentValueSetValidator GetPublishedContentValueSetValidator() =>
        new ContentValueSetValidator(true, true, _publicAccessService, _scopeProvider);
    public IValueSetValidator GetMemberValueSetValidator() => new MemberValueSetValidator();
}Matthew Alexandros
08/18/2024, 9:37 PMJemayn
08/21/2024, 7:09 AMGetContentValueSetValidator is used by the internal index and the GetPublishedContentValueSetValidator is used by the external index 🙂Matthew Alexandros
08/21/2024, 8:41 AMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by