azure - 当结果具有相同分数时在 Azure 搜索中进行分页

标签 azure search azure-cognitive-search scoring

我在电子商务网站上使用 Azure 搜索,现在我在搜索页面上遇到分页问题。当我重新加载搜索页面时,我可以获得不同的产品顺序。因此,当我使用分页时,我可以在不同页面上看到相同的产品,这一点至关重要。

我开始研究出了什么问题,我在 Microsoft 文档 https://learn.microsoft.com/en-us/rest/api/searchservice/add-scoring-profiles-to-a-search-index#what-is-default-scoring 上找到了此信息

Search score values can be repeated throughout a result set. For example, you might have 10 items with a score of 1.2, 20 items with a score of 1.0, and 20 items with a score of 0.5. When multiple hits have the same search score, the ordering of same scored items is not defined, and is not stable. Run the query again, and you might see items shift position. Given two items with an identical score, there is no guarantee which one appears first.

因此,如果我正确理解,我将面临这个问题,因为产品具有相同的分数。

如何解决这个问题?

最佳答案

你猜对了!由于您获得的产品具有相同的分数,因此无法保证哪个产品首先出现。 为了避免在此阶段发生这种情况,您可以向 $orderby 参数添加一个具有唯一值的字段,这样就可以保证相同的顺序。然而,这种方法没有考虑评分。我们目前正在研究这个问题的解决方案。一旦解决方案可用,我们将更新此答案(此时的预计时间是几周,而不是几个月)。

关于azure - 当结果具有相同分数时在 Azure 搜索中进行分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43592776/

相关文章:

php - 在 Facebook 应用程序中存储或不存储数据

mysql - Thinking-sphinx 返回不符合标准的结果

c# - 是否可以在 Azure 搜索索引中填充集合?

azure - Azure 搜索中所需的字符数

powershell - 在从 VSTS 进行新部署之前删除 Azure 上的文件和文件夹

c++ - 如何检查二进制文件中是否存在字符串?

azure - 无法将 "WindowsAzure.Storage"依赖项添加到 .Net Core (ASP.NET 5) 类库

azure - 我想在azure搜索中从不同的数据库表中获取数据,可以吗?或任何其他解决方法或最佳搜索

azure - 为什么 "Application permissions"在 Azure AD 的 "Request API permissions"中被禁用?

php - Bing 搜索 API 演示 key 有任何限制吗?