Skip to content

Commit

Permalink
Refactor search client
Browse files Browse the repository at this point in the history
  • Loading branch information
dluc committed Nov 23, 2024
1 parent 4b6b0e8 commit 04994ca
Show file tree
Hide file tree
Showing 3 changed files with 272 additions and 192 deletions.
10 changes: 5 additions & 5 deletions service/Core/MemoryStorage/MemoryRecordExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public static string GetFileContentType(this MemoryRecord record, ILogger? log =
/// </summary>
public static string GetWebPageUrl(this MemoryRecord record, string indexName, ILogger? log = null)
{
var fileDownloadUrl = Constants.HttpDownloadEndpointWithParams
var webPageUrl = record.GetPayloadValue(Constants.ReservedPayloadUrlField, log)?.ToString();

if (!string.IsNullOrWhiteSpace(webPageUrl)) { return webPageUrl; }

return Constants.HttpDownloadEndpointWithParams
.Replace(Constants.HttpIndexPlaceholder, indexName, StringComparison.Ordinal)
.Replace(Constants.HttpDocumentIdPlaceholder, record.GetDocumentId(), StringComparison.Ordinal)
.Replace(Constants.HttpFilenamePlaceholder, record.GetFileName(), StringComparison.Ordinal);

var webPageUrl = record.GetPayloadValue(Constants.ReservedPayloadUrlField, log)?.ToString();

return string.IsNullOrWhiteSpace(webPageUrl) ? fileDownloadUrl : webPageUrl;
}

/// <summary>
Expand Down
Loading

0 comments on commit 04994ca

Please sign in to comment.