Skip ExamineComposer if not on windows

This commit is contained in:
Bjarke Berg
2020-08-26 10:50:31 +02:00
parent c561b256bf
commit f286fdd855

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Examine;
using Umbraco.Core;
using Umbraco.Core.Composing;
@@ -20,8 +21,13 @@ namespace Umbraco.Web.Search
{
public override void Compose(Composition composition)
{
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
if(!isWindows) return;
base.Compose(composition);
// populators are not a collection: one cannot remove ours, and can only add more
// the container can inject IEnumerable<IIndexPopulator> and get them all
composition.Register<MemberIndexPopulator>(Lifetime.Singleton);