We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
对之前的误导性答案表示歉意。我没有注意到您使用的是 MQL 扩展“搜索”而不是“名称”属性。
主要问题是默认排序不是按搜索分数排序(不知道为什么,但事实就是如此)。像this这样修改您的查询应该可以解决问题:
排序参数按从返回的“分数”值降序排序“搜索”子查询。您还可以使用 mql_filter 参数进行搜索,使其甚至不考虑无法满足您的约束的事物(稍微更有效)。
搜索扩展记录在此处以及底层搜索服务的文档中即使用此处
Sorry about the previous misleading answer. I didn't notice that you were using the MQL extension "search" rather than the "name" property.
The main problem is that the default ordering is not by search score (not sure why, but that's the way it is). Modifying your query like this should fix things:
The sort parameter is sorting in descending order by the "score" value returned from the "search" subquery. You could also use the mql_filter parameter for search to have it not even consider things which fail to meet your constraint (slightly more efficient).
The search extension is documented here and the document for the underlying search service that is uses are here