From ba129fa927c8674c9d2482dfdbf8f9ab04346507 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 26 Aug 2020 12:01:01 +0200 Subject: [PATCH] Skip ExamineLuceneComposer if not on windows and reintroduce ExamineComposer --- src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs | 7 ++++++- src/Umbraco.Infrastructure/Search/ExamineComposer.cs | 10 +--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs b/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs index 724149a01d..b7d9cde9d1 100644 --- a/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs +++ b/src/Umbraco.Examine.Lucene/ExamineLuceneComposer.cs @@ -1,4 +1,5 @@ -using Umbraco.Core; +using System.Runtime.InteropServices; +using Umbraco.Core; using Umbraco.Core.Composing; namespace Umbraco.Examine @@ -10,6 +11,10 @@ namespace Umbraco.Examine { public override void Compose(Composition composition) { + var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + if(!isWindows) return; + + base.Compose(composition); composition.RegisterUnique(); diff --git a/src/Umbraco.Infrastructure/Search/ExamineComposer.cs b/src/Umbraco.Infrastructure/Search/ExamineComposer.cs index 9feb9c369f..68a1213629 100644 --- a/src/Umbraco.Infrastructure/Search/ExamineComposer.cs +++ b/src/Umbraco.Infrastructure/Search/ExamineComposer.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Runtime.InteropServices; -using Examine; -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; @@ -21,13 +18,8 @@ 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 and get them all composition.Register(Lifetime.Singleton);