From 3d6ee18822ac0699e29b629540f9d7d55222747a Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Mon, 23 Sep 2024 17:36:42 +0200 Subject: [PATCH] feat: map relevance score to search document --- .../VirtoCommerce.ElasticAppSearch.Core.csproj | 2 +- .../Services/Converters/DocumentConverter.cs | 3 +++ .../VirtoCommerce.ElasticAppSearch.Data.csproj | 2 +- src/VirtoCommerce.ElasticAppSearch.Web/module.manifest | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/VirtoCommerce.ElasticAppSearch.Core/VirtoCommerce.ElasticAppSearch.Core.csproj b/src/VirtoCommerce.ElasticAppSearch.Core/VirtoCommerce.ElasticAppSearch.Core.csproj index ecaecb0..2dd7aee 100644 --- a/src/VirtoCommerce.ElasticAppSearch.Core/VirtoCommerce.ElasticAppSearch.Core.csproj +++ b/src/VirtoCommerce.ElasticAppSearch.Core/VirtoCommerce.ElasticAppSearch.Core.csproj @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/src/VirtoCommerce.ElasticAppSearch.Data/Services/Converters/DocumentConverter.cs b/src/VirtoCommerce.ElasticAppSearch.Data/Services/Converters/DocumentConverter.cs index f9203c6..1ba1fa5 100644 --- a/src/VirtoCommerce.ElasticAppSearch.Data/Services/Converters/DocumentConverter.cs +++ b/src/VirtoCommerce.ElasticAppSearch.Data/Services/Converters/DocumentConverter.cs @@ -7,6 +7,7 @@ using VirtoCommerce.ElasticAppSearch.Core.Models.Api.Documents; using VirtoCommerce.ElasticAppSearch.Core.Models.Api.Schema; using VirtoCommerce.ElasticAppSearch.Core.Services.Converters; +using VirtoCommerce.SearchModule.Core.Extensions; using VirtoCommerce.SearchModule.Core.Model; using SearchGeoPoint = VirtoCommerce.SearchModule.Core.Model.GeoPoint; @@ -111,6 +112,8 @@ public SearchDocument ToSearchDocument(Core.Models.Api.Search.Result.SearchResul searchDocument.Add(indexFieldName, indexFieldValue); } + searchDocument.SetRelevanceScore(searchResultDocument.Meta?.Score); + return searchDocument; } } diff --git a/src/VirtoCommerce.ElasticAppSearch.Data/VirtoCommerce.ElasticAppSearch.Data.csproj b/src/VirtoCommerce.ElasticAppSearch.Data/VirtoCommerce.ElasticAppSearch.Data.csproj index c5c9bbc..8e72787 100644 --- a/src/VirtoCommerce.ElasticAppSearch.Data/VirtoCommerce.ElasticAppSearch.Data.csproj +++ b/src/VirtoCommerce.ElasticAppSearch.Data/VirtoCommerce.ElasticAppSearch.Data.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/src/VirtoCommerce.ElasticAppSearch.Web/module.manifest b/src/VirtoCommerce.ElasticAppSearch.Web/module.manifest index f8afda8..7faa39f 100644 --- a/src/VirtoCommerce.ElasticAppSearch.Web/module.manifest +++ b/src/VirtoCommerce.ElasticAppSearch.Web/module.manifest @@ -4,9 +4,9 @@ 3.805.0 - 3.800.0 + 3.825.0 - +