【发布时间】:2020-07-12 21:59:36
【问题描述】:
在这里,我使用查询从 azure 搜索索引中检索产品列表。在此,我获得了特定产品的图像列表。
public class ProductImage
{
public string Id { get; set; }
[IsSearchable]
public string ActualSizeUrl { get; set; }
public string ThumbnailUrl { get; set; }
}
例如,我目前正在获取以下实际大小的 url:5de4ff7246bfe0002579328b/5da957c9e158618c1bbce366.jpg
使用此代码
var results = _indexClient.Documents.Search<Product>(searchText, parameters);
IEnumerable<SearchResult<Product>> itemList = results.Results.AsEnumerable();
IEnumerable<SearchResultItem> items = itemList.Select(x => new SearchResultItem
{
Data = x.Document,
Confidence = x.Score,
Type = Enum.GetName(typeof(SearchType), SearchType.Product),
});
当我从搜索索引中检索时,如何实现这样的实际大小 URL:http://localhost:10000/devstoreaccount1/5de4ff7246bfe0002579328b/5da957c9e158618c1bbce366.jpg
【问题讨论】:
标签: c# linq asp.net-core azure-cognitive-search