Skip to content

Make it possible to disable Examine indexes by composition#18988

Merged
Migaroez merged 1 commit intov16/devfrom
v16/feature/disable-examine-by-composition
Apr 9, 2025
Merged

Make it possible to disable Examine indexes by composition#18988
Migaroez merged 1 commit intov16/devfrom
v16/feature/disable-examine-by-composition

Conversation

@kjac
Copy link
Copy Markdown
Contributor

@kjac kjac commented Apr 9, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Description

The upcoming search abstraction layer will need to work as an add-on to V16. For this to happen, we need to be able to disable the current Examine indexes, to let the search abstraction take over.

This PR moves the Examine DI setup to a composer, because composers can be omitted by code 😄

Testing this PR

First and foremost, make sure Examine still works as per usual - that is, indexing and search still works.

Now add a new composer which disables the AddExamineComposer of this PR. Something along these lines:

using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Infrastructure.Examine;

namespace Umbraco.Cms.Web.UI.Custom.Search;

[Disable(typeof(AddExamineComposer))]
public class DisableExamineComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
    }
}

Restart Umbraco. The Examine indexes should no longer appear in the Examine Management dashboard.

Copy link
Copy Markdown
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised 🚀

@Migaroez Migaroez merged commit ff58fbd into v16/dev Apr 9, 2025
25 of 26 checks passed
@Migaroez Migaroez deleted the v16/feature/disable-examine-by-composition branch April 9, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants