Sitecore Azure 搜索读取@search.score 值

Sitecore Azure Search read @search.score value

我不确定这个问题是在 Sitecore ContentSearch API 中还是纯粹与 Azure 搜索有关(因此在这里而不是在 https://sitecore.stackexchange.com/ 上询问)。

我正在使用 search.score() 方法以及其他排序标准对结果进行排序。是否可以在我的结果中输出 search.score() 的值以进行调试?

当我 运行 使用邮递员进行查询时,我在返回的文档中看到 JSON 属性 称为 @search.score 但是当我尝试在代码中引用它时 Sitecore.ContentSearch.SearchTypes.SearchResultItem 我刚得到异常:"The given key was not present in the dictionary.").

根据 Sitecore Azure Search documentation 提供者不支持评分配置文件。这可能就是您遇到此问题的原因。

Refer to the following list for features that exist in Azure that are not currently supported by your Sitecore provider:

  • Scoring profiles
  • Geospatial data types
  • Indexers
  • Suggestions
  • Highlighters

支持的字段列表也可在 Azure Search configuration documentation 中找到。这会列出 'boost' 字段,但不会列出分数字段。