diff --git a/src/VirtoCommerce.OrdersModule.Core/Model/CustomerOrder.cs b/src/VirtoCommerce.OrdersModule.Core/Model/CustomerOrder.cs index dabf8790..88db4318 100644 --- a/src/VirtoCommerce.OrdersModule.Core/Model/CustomerOrder.cs +++ b/src/VirtoCommerce.OrdersModule.Core/Model/CustomerOrder.cs @@ -6,10 +6,11 @@ using VirtoCommerce.Platform.Core.Common; using VirtoCommerce.Platform.Core.Domain; using VirtoCommerce.Platform.Core.Security; +using VirtoCommerce.SearchModule.Core.Model; namespace VirtoCommerce.OrdersModule.Core.Model { - public class CustomerOrder : OrderOperation, IHasTaxDetalization, ISupportSecurityScopes, ITaxable, IHasLanguage, IHasDiscounts, ICloneable, IHasFeesDetalization + public class CustomerOrder : OrderOperation, IHasTaxDetalization, ISupportSecurityScopes, ITaxable, IHasLanguage, IHasDiscounts, ICloneable, IHasFeesDetalization, IHasRelevanceScore { public byte[] RowVersion { get; set; } @@ -65,6 +66,8 @@ public class CustomerOrder : OrderOperation, IHasTaxDetalization, ISupportSecuri public ICollection FeeDetails { get; set; } + public double? RelevanceScore { get; set; } + #region IHasDiscounts public ICollection Discounts { get; set; } #endregion diff --git a/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj b/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj index 960716e3..b44bf2d1 100644 --- a/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj +++ b/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj @@ -23,5 +23,6 @@ + \ No newline at end of file diff --git a/src/VirtoCommerce.OrdersModule.Data/Search/Indexed/IndexedCustomerOrderSearchService.cs b/src/VirtoCommerce.OrdersModule.Data/Search/Indexed/IndexedCustomerOrderSearchService.cs index 8931b1e0..969d7b3a 100644 --- a/src/VirtoCommerce.OrdersModule.Data/Search/Indexed/IndexedCustomerOrderSearchService.cs +++ b/src/VirtoCommerce.OrdersModule.Data/Search/Indexed/IndexedCustomerOrderSearchService.cs @@ -12,6 +12,7 @@ using VirtoCommerce.Platform.Core.Common; using VirtoCommerce.Platform.Core.Settings; using VirtoCommerce.SearchModule.Core.Exceptions; +using VirtoCommerce.SearchModule.Core.Extensions; using VirtoCommerce.SearchModule.Core.Model; using VirtoCommerce.SearchModule.Core.Services; @@ -89,7 +90,17 @@ protected virtual async Task> ConvertDocumentsAsync(IList itemsMap.TryGetValue(x.Id, out var item) ? item : null) + .Select(doc => + { + var order = itemsMap.TryGetValue(doc.Id, out var value) ? value : null; + + if (order != null) + { + order.RelevanceScore = doc.GetRelevanceScore(); + } + + return order; + }) .Where(x => x != null) .ToArray(); diff --git a/src/VirtoCommerce.OrdersModule.Data/VirtoCommerce.OrdersModule.Data.csproj b/src/VirtoCommerce.OrdersModule.Data/VirtoCommerce.OrdersModule.Data.csproj index ca00d56b..6acc4ec8 100644 --- a/src/VirtoCommerce.OrdersModule.Data/VirtoCommerce.OrdersModule.Data.csproj +++ b/src/VirtoCommerce.OrdersModule.Data/VirtoCommerce.OrdersModule.Data.csproj @@ -19,8 +19,8 @@ + - diff --git a/src/VirtoCommerce.OrdersModule.Web/module.manifest b/src/VirtoCommerce.OrdersModule.Web/module.manifest index 8a901cc3..4de119dd 100644 --- a/src/VirtoCommerce.OrdersModule.Web/module.manifest +++ b/src/VirtoCommerce.OrdersModule.Web/module.manifest @@ -13,7 +13,7 @@ - +