From 2528c99d30eaf73b8865ff0783b374fc737711d1 Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Fri, 7 Oct 2022 16:38:55 -0400 Subject: [PATCH 1/2] Deprecate ILuceneSearchQueryService in OrchardCore.Search.Lucene Moved to OrchardCore.Search.Lucene.Abstractions --- .../Services/ILuceneSearchQueryService.cs | 10 ++++++++++ .../Services/LuceneSearchQueryService.cs | 2 +- .../OrchardCore.Search.Lucene/Startup.cs | 2 +- .../ILuceneSearchQueryService.cs | 4 ++-- .../OrchardCore.Search.Lucene.Abstractions.csproj | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/ILuceneSearchQueryService.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/ILuceneSearchQueryService.cs index 32d8ac4be00..8fa536bc2c2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/ILuceneSearchQueryService.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/ILuceneSearchQueryService.cs @@ -1,11 +1,21 @@ +using System; using System.Collections.Generic; using System.Threading.Tasks; using Lucene.Net.Search; namespace OrchardCore.Search.Lucene.Services { + [Obsolete("This interface has been deprecated and we will be removed in the next major release, please use OrchardCore.Search.Lucene.Abstractions instead.", false)] public interface ILuceneSearchQueryService { + /// + /// Provides a way to execute a search request in Lucene based on a Lucene Query. + /// + /// + /// + /// + /// + /// IList<string> Task> ExecuteQueryAsync(Query query, string indexName, int start = 0, int end = 20); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneSearchQueryService.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneSearchQueryService.cs index 6d6788478e6..f4e17b647ee 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneSearchQueryService.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneSearchQueryService.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Search.Lucene.Services { - public class LuceneSearchQueryService : ILuceneSearchQueryService + public class LuceneSearchQueryService : Abstractions.ILuceneSearchQueryService { private readonly LuceneIndexManager _luceneIndexManager; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Startup.cs index d211fca9d76..c90e32f6a3a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Startup.cs @@ -60,7 +60,7 @@ public override void ConfigureServices(IServiceCollection services) services.AddSingleton(); services.AddScoped(); services.AddScoped(); - services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/ILuceneSearchQueryService.cs b/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/ILuceneSearchQueryService.cs index b8d9249105e..c3b4279f3b9 100644 --- a/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/ILuceneSearchQueryService.cs +++ b/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/ILuceneSearchQueryService.cs @@ -2,9 +2,9 @@ using System.Threading.Tasks; using Lucene.Net.Search; -namespace OrchardCore.Search.Lucene +namespace OrchardCore.Search.Lucene.Abstractions { - public interface ISearchQueryService + public interface ILuceneSearchQueryService { /// /// Provides a way to execute a search request in Lucene based on a Lucene Query. diff --git a/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj b/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj index 0988bcbb0bd..c3130223c35 100644 --- a/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj +++ b/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj @@ -1,7 +1,7 @@ - OrchardCore.Search.Lucene + OrchardCore.Search.Lucene.Abstractions OrchardCore Lucene Abstractions $(OCCMSDescription) From 84b30cfcebba135ed5ebe5ecf562d0fbc728def4 Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Fri, 7 Oct 2022 16:49:46 -0400 Subject: [PATCH 2/2] revert --- .../OrchardCore.Search.Lucene.Abstractions.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj b/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj index c3130223c35..0988bcbb0bd 100644 --- a/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj +++ b/src/OrchardCore/OrchardCore.Search.Lucene.Abstractions/OrchardCore.Search.Lucene.Abstractions.csproj @@ -1,7 +1,7 @@ - OrchardCore.Search.Lucene.Abstractions + OrchardCore.Search.Lucene OrchardCore Lucene Abstractions $(OCCMSDescription)