天蓝色搜索按得分排序和筛选 [英] azure search sort and filter by score

查看:69
本文介绍了天蓝色搜索按得分排序和筛选的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过天蓝色搜索按分数过滤和排序结果.

I want to know how to filter and order the results by score with azure search.

我尝试过:

https://domaine.net/indexes/indexName/docs?search=TEST$orderby=@search.score%20desc&$count=true

返回:

object(stdClass)#322 (1) {
  ["error"]=>
  object(stdClass)#323 (2) {
    ["code"]=>
    string(0) ""
    ["message"]=>
    string(96) "Invalid expression: Syntax error at position 8 in '@search.score asc'.
Parameter name: $orderby"
  }
}

推荐答案

默认情况下,结果按得分(降序)排序.如果按其他条件排序,则得分用于打破平局.如果要显式按分数排序,则可以使用$orderby参数中的search.score()函数.在此处记录.

Results are sorted by score (descending) by default. If you sort by other criteria, score is used to break ties. If you want to sort by score explicitly, you can use the search.score() function in the $orderby parameter. It is documented here.

当前无法按分数过滤.由于分数的变化不仅取决于查询,还取决于数据语料库,因此,我很想了解您的情况,以便更好地根据分数进行过滤.

It's not currently possible to filter by score. Since score varies as a function of not only the query but also the data corpus, I would be curious to understand your scenario better for filtering based on a score number.

这篇关于天蓝色搜索按得分排序和筛选的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆