在 RediSearch 中,可选查询和权重如何工作?
现在,当我尝试搜索关键字并使用带有权重的可选查询来提升结果时,它似乎没有做任何事情。
我已经尝试过 RediSearch1.4.0
和1.4.15
.
我有一个索引文档,其中包含不同大小的不同 TEXT 字段,并且在索引时我已经给了它们document_score
。现在我希望我的用户能够通过查询来搜索文档,但我想将那些与查询完全匹配的结果提升到顶部。
我见过 redis 提供的评分算法,但它们似乎都没有对$weight
我们提供给子查询的内容做任何事情。他们都在谈论field weights
和document_score
查询词频。他们都没有在查询中谈论$weight
它将如何影响最终结果。
假设我有 4 个具有不同文本字段的文档。其中之一是title
字段TEXT
。每4个文档的标题字段条目如下:
"mohsin conversation with the mohsin"
"conversation the conversation - a drama about conversation, the science of conversation."
"Fareham Community Church - Sermons and conversations mohsin conversation the"
"mohsin conversation the conversation tahir"
当我生成以下查询以重新搜索时
@title:(conversation the conversation*) (~@title:"conversation the conversation"=>{$weight: 10;})
我希望具有精确的文档conversation the conversation
位于顶部,所有其他结果(倾斜距离> 0)在它们之后。
但是输出完全不同。IE
"Fareham Community Church - Sermons and conversations mohsin conversation the"
"mohsin conversation with the mohsin"
"conversation the conversation - a drama about conversation, the science of conversation."
"mohsin conversation the conversation tahir"
所以我想了解子查询权重在最终结果中的作用。