如何在 Sphinxsearch 中对包含特定术语的搜索结果进行优先排序?

问题描述 投票:0回答:0

我在以下 Sphinxsearch 查询 (SphinxSE) 中遇到搜索结果排序问题。具体来说,我想优先显示包含术语“asda”的结果,并将它们显示在列表的顶部,然后再显示剩余的标题。

目前,查询使用 attr_desc:@weight 参数按 @weight 属性降序排列结果。有没有办法修改此查询以实现所需的排序行为?我可以为每个搜索词增加权重吗?

这里是查询原文供参考:

`query` = 'query=@title asda|coop|tesco; limit=15; mode=extended; sort=attr_desc:@weight; index=products_index; fieldweights=title,8,description,2,recruiter,1; host=127.0.0.1; port=9312; ranker=proximity_bm25; maxmatches=1000;'
search sphinx sphinxsearch
© www.soinside.com 2019 - 2024. All rights reserved.